4
votes
DrupalDateTime::createFromFormat() returns the wrong time value
I can see nothing unexpected. Midnight in UTC is 8 PM the day before in New York, at least in the summer time.
Timestamps are always UTC. This is the reason why your second attempt
$from = ...
1
vote
DrupalDateTime::createFromFormat() returns the wrong time value
DrupalDateTime::createFromFormat() is basically a wrapper for PHP's createFromFormat.
A search of the PHP docs reveals this comment:
createFromFormat('U') has a strange behaviour: it ignores the
...
1
vote
DrupalDateTime::createFromFormat() returns the wrong time value
I tried different snippets, but they all output a time for June 12, not for June 13.
echo DrupalDateTime::createFromFormat('U', strtotime('last week monday'), new \DateTimeZone('America/New_York'))
-...
1
vote
How to use date_date_callbacks
Checking the official documentation of DateTime class, it appears that it calls all the function names passed as string in the #date_date_callback array (check processDatetime function).
// Allows ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
datetime × 1215views × 403
7 × 402
8 × 172
entities × 153
theming × 76
nodes × 71
forms × 68
javascript × 40
rules × 38
i18n-l10n × 30
6 × 28
webforms × 27
database × 25
users × 23
feeds × 14
tokens × 14
migrations × 13
commerce × 12
blocks × 10
ajax × 10
emails × 10
importing-exporting × 10
hooks × 8
9 × 8