Convert specific BigInt to DateTime in T-SQL
问题 I have bigInt: 635307578922100000 which I need to convert to DateTime . I've tried few ways to do this: SELECT DATEADD(S, CONVERT(bigint,635307578922100000) / 1000, CONVERT(DATETIME, '1-1-1970 00:00:00')) and: SELECT DATEADD(ms, 635307578922100000 / 86400000, (635307578922100000 / 86400000) +25567) While I found the codes above work with bigInts like: 1283174502729 , with my bigInt I get the following error: Msg 8115 ... Arithmetic overflow error converting expression to data type datetime.