Skip to content

Commit

Permalink
Fix creation from floating points
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 17, 2024
1 parent 22c9231 commit a01a576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/php/util/Date.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct($in= null, ?TimeZone $timezone= null) {

// Timestamps with microseconds are defined as `"@" "-"? [0-9]+ "." [0-9]{0,6}`,
// see https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative
$this->handle= date_create('@'.sprintf('%.6f', $in);
$this->handle= date_create('@'.sprintf('%.6f', $in));
$timezone && date_timezone_set($this->handle, $timezone->getHandle());
} else {
if (false === ($this->handle= date_create($in ?? 'now', $timezone ? $timezone->getHandle() : null))) {
Expand Down

0 comments on commit a01a576

Please sign in to comment.