Wrapper for PHP's DateTime class inspired by moment.js
{{test01}}
Date: 15.05.2012 12:30:00 (CET)
{{test02}}
Date: 15.05.2012 12:30:00 (CET)
{{test03}}
Date#1: 12.05.2012 / 15:00:00 (UTC)
Date#2: 25.09.2011 / 10:00:00 (UTC)
Difference seconds: {{test04.01}}
Difference in minutes: {{test04.02}}
Difference in hours: {{test04.03}}
Difference in days: {{test04.04}}
Difference in weeks: {{test04.05}}
Difference in months: {{test04.06}}
Difference in years: {{test04.07}}
Difference relative: {{test04.08}}
Date#1: {{test05.00}}
Difference seconds: {{test05.01}}
Difference in minutes: {{test05.02}}
Difference in hours: {{test05.03}}
Difference in days: {{test05.04}}
Difference in weeks: {{test05.05}}
Difference in months: {{test05.06}}
Difference in years: {{test05.07}}
Difference relative: {{test05.08}}
CET: {{test06.01}}
UTC: {{test06.02}}
{{test07.00}}
Default locale (L): {{test07.01}}
{{test07.locale}} locale (LT): {{test07.02}}
{{test07.locale}} locale (L): {{test07.03}}
{{test07.locale}} locale (l): {{test07.04}}
{{test07.locale}} locale (LL): {{test07.05}}
{{test07.locale}} locale (ll): {{test07.06}}
{{test07.locale}} locale (LLL): {{test07.07}}
{{test07.locale}} locale (lll): {{test07.08}}
{{test07.locale}} locale (LLLL): {{test07.09}}
{{test07.locale}} locale (llll): {{test07.10}}
Moment.php format:
"l, F jS Y g:i A"
{{test09.01}}
Moment.js
"LLLL"
{{test09.02}}
Moment.php format: (with fixed ordinal representation)
"WS [week of the year]"
{{test09.03}}
Moment.js
"WO"
{{test09.04}}
Calendar time displays time relative to now, but slightly differently than moment::fromNow.
moment::calendar will format a date with different strings depending on how close to today the date is.
Last week
{{test10.01}}
The day before
{{test10.02}}
The same day
{{test10.03}}
The next day
{{test10.04}}
Upcoming days
{{test10.05}}
Everything else
{{test10.06}}
Reference date {{test11.00}}
Reference date {{test12.00}}