We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4d4fce commit 6299ce8Copy full SHA for 6299ce8
tests/Unit/Models/Attributes/TimestampTest.php
@@ -146,4 +146,17 @@ public function test_windows_int_type_properly_handles_minimum()
146
$this->assertSame($min, $timestamp->toDateTime($min));
147
$this->assertSame($min, $timestamp->toDateTime((string) $min));
148
}
149
+
150
+ public function test_windows_int_type_rounds_correctly()
151
+ {
152
+ $timestamp = new Timestamp('windows-int');
153
154
+ foreach (['133692539995000000', '133692539999500000'] as $windowsIntegerTime) {
155
+ $dateTime = $timestamp->toDateTime($windowsIntegerTime);
156
157
+ $expectedUnixTimestamp = (int) ($windowsIntegerTime / 10000000) - 11644473600;
158
159
+ $this->assertEquals($expectedUnixTimestamp, $dateTime->getTimestamp());
160
+ }
161
162
0 commit comments