Created
May 7, 2020 06:26
-
-
Save caramelchocolate/62ed2dba4babafe93ca8c1fbc1aac2c7 to your computer and use it in GitHub Desktop.
DateTimeImmutable
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
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
$date = new DateTimeImmutable(); | |
var_dump($date->format('Y-m-d H:i:s.u')); | |
var_dump($date->format('Y-m-d H:i:s.v')); | |
$date = new DateTimeImmutable('2020-04-20 11:12:13'); | |
var_dump($date->format('U')); | |
var_dump(mktime($hour=11, $minute=12, $second=13, $month=4, $day=20, $year=2020)); | |
?> |
Author
caramelchocolate
commented
May 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment