note 114461 added to intlcalendar.fromdatetime
| From: | SenseException | Date: | Sun, 23 Feb 2014 14:06:58 +0000 |
| Subject: | note 114461 added to intlcalendar.fromdatetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198598@lists.php.net to get a copy of this message | ||
Don't forget that fromDateTime() doesn't set any locale and that the default one will be
set. In my case it was en_US_POSIX.
If you wan't to create a IntlCalendar object containing the values of a DateTime object with
your locale, use createInstance() instead and do a
<?php
$intlCalendar->setTime($dateTime->getTimestamp() * 1000);
?>
IntlCalendar works with milliseconds so you need to multiply the timestamp with 1000.
Using fromDateTime() can cause unwanted behaviour like getFirstDayOfWeek() returning a wrong
integer.
----
Server IP: 92.48.119.85
Probable Submitter: 78.53.218.2
----
Manual Page -- http://php.net/manual/en/intlcalendar.fromdatetime.php
Edit -- https://master.php.net/note/edit/114461
Del: integrated -- https://master.php.net/note/delete/114461/integrated
Del: useless -- https://master.php.net/note/delete/114461/useless
Del: bad code -- https://master.php.net/note/delete/114461/bad+code
Del: spam -- https://master.php.net/note/delete/114461/spam
Del: non-english -- https://master.php.net/note/delete/114461/non-english
Del: in docs -- https://master.php.net/note/delete/114461/in+docs
Del: other reasons-- https://master.php.net/note/delete/114461
Reject -- https://master.php.net/note/reject/114461
Search -- https://master.php.net/manage/user-notes.php