- Date.toTime (Date.date {day = intFromSql day, hour = intFromSql mon, minute = intFromSql minute,
- month = toMonth (intFromSql mon),
- offset = SOME (Time.fromSeconds (Int32.fromInt (intFromSql offset * 3600))),
- second = intFromSql second div 1000, year = intFromSql year})
- | _ => raise Format "Invalid timestamp"
+ Date.toTime (Date.date {day = valOf (Int.fromString day), hour = valOf (Int.fromString hour), minute = valOf (Int.fromString minute),
+ month = toMonth (valOf (Int.fromString mon)),
+ offset = SOME (Time.fromSeconds (LargeInt.fromInt (valOf (Int.fromString offset) * 3600))),
+ second = valOf (Int.fromString second) div 1000, year = valOf (Int.fromString year)})
+ | [year, mon, day, hour, minute, second, _] =>
+ Date.toTime (Date.date {day = valOf (Int.fromString day), hour = valOf (Int.fromString hour), minute = valOf (Int.fromString minute),
+ month = toMonth (valOf (Int.fromString mon)),
+ offset = NONE,
+ second = valOf (Int.fromString second), year = valOf (Int.fromString year)})
+ | [year, mon, day, hour, minute, second] =>
+ Date.toTime (Date.date {day = valOf (Int.fromString day), hour = valOf (Int.fromString hour), minute = valOf (Int.fromString minute),
+ month = toMonth (valOf (Int.fromString mon)),
+ offset = NONE,
+ second = valOf (Int.fromString second) div 1000, year = valOf (Int.fromString year)})
+ | _ => raise Format ("Invalid timestamp " ^ s)