-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Implement UTCDateTime::toDateTimeImmutable * Refactor UTCDateTime::toDateTime functions
- Loading branch information
Showing
7 changed files
with
76 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
MongoDB\BSON\UTCDateTime::toDateTimeImmutable() | ||
--INI-- | ||
date.timezone=America/Los_Angeles | ||
--FILE-- | ||
<?php | ||
|
||
$utcdatetime = new MongoDB\BSON\UTCDateTime("1416445411987"); | ||
$datetime = $utcdatetime->toDateTimeImmutable(); | ||
var_dump(get_class($datetime)); | ||
var_dump($datetime->format(DATE_RSS)); | ||
|
||
?> | ||
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECT-- | ||
string(17) "DateTimeImmutable" | ||
string(31) "Thu, 20 Nov 2014 01:03:31 +0000" | ||
===DONE=== |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
MongoDB\BSON\UTCDateTime::toDateTimeImmutable() dumping seconds and microseconds | ||
--INI-- | ||
date.timezone=UTC | ||
--FILE-- | ||
<?php | ||
|
||
$utcdatetime = new MongoDB\BSON\UTCDateTime("1416445411987"); | ||
$datetime = $utcdatetime->toDateTimeImmutable(); | ||
var_dump(get_class($datetime)); | ||
echo $datetime->format('U.u'), "\n"; | ||
|
||
?> | ||
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECT-- | ||
string(17) "DateTimeImmutable" | ||
1416445411.987000 | ||
===DONE=== |