Apologies my cap broke mid title.
I'm having issues with the following:
dateadd(S, [unixtime], '1970-01-01')
to convert epoch to datetime in SQL Server, but received the following error:
Arithmetic overflow error converting expression to data type int.
Obviously it means the epoch is too big for int? even though this code has worked previously; bizarrely. is there a way to call this with bigint?
eg epoch:
1440753397054
and I believe the limit is 10 digits, so an alternative?
Your timestamp is in milliseconds. Try dividing it by 1000 and I'm sure it will work.
1440753397054 / 1000 = 1440753397,054 corresponds to (assuming GMT):
Fri, 28 Aug 2015 09:16:37 GMT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With