Home > database >  How the digital type field in the SQL type fields back into a date
How the digital type field in the SQL type fields back into a date

Time:10-13

1546315123
1546313399
Is the above two figures real date type, but the current database with digital type field in the storage, how to restore a date type fields

CodePudding user response:

Didn't see what's the date of the two Numbers date
Use the Convert function can be converted to date format you need
For example,
Select the convert (datetime, '10/15/2019, 120) can output in 2019-10-15

CodePudding user response:

Looks like a timestamp, but shorter than normal time stamp three?

The select dateadd (hour, 8, dateadd (second, 1546313399, '1970-1-1'))

See if the result is expected as a result, if not, please provide the expected results
  • Related