File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,9 @@ static const REBI64 DAYS_OF_JAN_1ST_1970 = 719468; // number of days for 1st Jan
321
321
{
322
322
REBDAT d = VAL_DATE (date );
323
323
REBI64 epoch = (Days_Of_Date (d .date .day , d .date .month , d .date .year ) - DAYS_OF_JAN_1ST_1970 ) * SECS_IN_DAY ;
324
- return epoch + ((VAL_TIME (date ) + 500000000 ) / SEC_SEC );
324
+ REBI64 time = VAL_TIME (date );
325
+ if (time == NO_TIME ) time = 0 ;
326
+ return epoch + ((time + 500000000 ) / SEC_SEC );
325
327
}
326
328
327
329
/***********************************************************************
Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ Rebol [
92
92
--assert 1632142002 = to integer! 20-Sep-2021/12:46:41.7
93
93
--assert 1632135512 = make integer! 20-Sep-2021/12:58:32+2:00
94
94
--assert 1632135512 = to integer! 20-Sep-2021/12:58:32+2:00
95
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2550
96
+ --assert 1685750400 == to integer! 3-Jun-2023
97
+ --assert 1685750400 == to integer! 3-Jun-2023/0:00
98
+ --assert 1685750400 == make integer! 3-Jun-2023
99
+ --assert 1685750400 == make integer! 3-Jun-2023/0:00
100
+
95
101
--test-- "make/to integer! string!"
96
102
;@@ https://github.com/Oldes/Rebol-issues/issues/2164
97
103
--assert 9223372036854775807 = to integer! "9223372036854775807"
You can’t perform that action at this time.
0 commit comments