[BUG] in date conversion
[1/1] from: rebol-list2::seznam::cz at: 9-Sep-2003 17:20
Hello rebol-list,
as I'm exploring TTF file format, where dates follows the Macintosh
convention of the number of seconds since 1904 (8-byte field), I've found this
Rebol's bug:
to-time to-integer #{7FFFFFFF} ;max possible non negative integer
;== 596523:14:07 ;it looks ok but...
1-1-1904/0:0:0 + to-time to-integer #{7FFFFFFF}
;== 1-Jan-1904 ;<---- bug!
1-1-1904/0:0:0 + to-time to-integer #{7FFFFFFE}
;== 19-Jan-1972/3:14:06 <---this one is ok
so there is limit for time conversion to maximum of 2147483646 seconds
I'm not going report this bug because it's related to non existence
of unsigned long integer datatype in Rebol
I've this parse rule:
LONGDateTime: [4 skip copy v 4 skip (
v: to binary! v
v: either #{80000000} = and v #{80000000} [
19-Jan-1972/3:14:07 + to-time to-integer and v #{7FFFFFFF}
][ 1-1-1904/0:0:0 + to-time to-integer v]
)
]
as you can see I don't work with the first 4 bytes because this would
require more work:(
--
Best regards,
rebOldes mailto:[oliva--david--seznam--cz]