This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private String getCurrentTimeFormat(String timeFormat){ | |
| String time = ""; | |
| SimpleDateFormat df = new SimpleDateFormat(timeFormat); | |
| Calendar c = Calendar.getInstance(); | |
| time = df.format(c.getTime()); | |
| return time; | |
| } | |
| //Add certain number of days to Today |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.LocalDateTime; | |
| import java.time.temporal.ChronoUnit; | |
| public class DateTimeAPIStateless | |
| { | |
| public static void main( String[] args ) | |
| { | |
| LocalDateTime timeInThePast = LocalDateTime.now().withDayOfMonth( 5 ).withYear( 2005 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.Duration; | |
| import java.time.Instant; | |
| import java.time.LocalDate; | |
| import java.time.LocalTime; | |
| import java.time.Month; | |
| import java.time.Period; | |
| import java.time.ZoneId; | |
| import java.time.temporal.ChronoUnit; | |
| public class DurationsPeriodsAndInstants |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.Clock; | |
| import java.time.DayOfWeek; | |
| import java.time.LocalDate; | |
| import java.time.LocalDateTime; | |
| import java.time.LocalTime; | |
| import java.time.Month; | |
| import java.time.Year; | |
| import java.time.ZoneId; | |
| import java.time.ZoneOffset; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.LocalDate; | |
| import java.time.LocalDateTime; | |
| import java.time.Month; | |
| import java.time.format.DateTimeFormatter; | |
| import java.time.format.DateTimeParseException; | |
| import java.time.format.FormatStyle; | |
| import java.util.Locale; | |
| public class Parsing | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.DayOfWeek; | |
| import java.time.LocalDate; | |
| import java.time.temporal.TemporalAdjusters; | |
| public class TemporalAdjustersExamples | |
| { | |
| public static void main( String[] args ) | |
| { | |
| /* using adjuster is possible to adjust a given date */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.time.DateTimeException; | |
| import java.time.LocalDateTime; | |
| import java.time.OffsetTime; | |
| import java.time.ZoneId; | |
| import java.time.ZoneOffset; | |
| import java.time.ZonedDateTime; | |
| public class TimeZones | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Install composer | |
| 2. Require the parse Sdk | |
| 3. Create an Application and auto load. | |
| 4. Create the app folder where all the class files are going to reside | |
| "autoload": { | |
| "psr-0": { | |
| "app": "" | |
| }, | |
| "files": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Route::group(['prefix' => 'admin', 'namespace' => 'backend', 'before' => 'admin'], function() | |
| { | |
| // only /admin/ routes in here that will be in a namespace folder of "backend" with admin middleware | |
| Route::resource('pages', 'PagesController'); // app/Http/controllers/backend/PagesController.php | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="form-group {{ $errors->has('date_of_birth') ? 'has-error' : '' }}"> | |
| {{ Form::label('date_of_birth', 'Date of Birth', ['class' => 'control-label']) }} | |
| <div class="form-inline"> | |
| {{ Form::selectRange('date_of_birth[day]', 1, 31, null, ['class' => 'form-control']) }} | |
| {{ Form::selectMonth('date_of_birth[month]', null, ['class' => 'form-control']) }} | |
| {{ Form::selectYear('date_of_birth[year]', date('Y') - 3, date('Y') - 16, null, ['class' => 'form-control']) }} | |
| </div> | |
| {{ $errors->first('date_of_birth', '<span class="help-block">:message</span>') }} | |
| </div> |