I have a date/ time field in my database with the type set to 'decimal'.
When querying the date/ time field using the below query:
SELECT my_date_time_field
FROM my_table
It returns the following result (an example):
1323977278
This is meant to represent the following date and time (UK date format):
30/11/2011 02:50:19 AM
I have been told that the result I get from the database is how many seconds have passed since:
01-JAN-1970 00:00:00
I would like to know how I can get my SQL query result to display the date in the proper UK date format.
I have tried the following and it did not work from a similar question:
CONVERT(DATETIME, CAST(my_date_time_field AS VARCHAR(8)), 112)
Should I be converting my_date_time_field to the YYYYMMDDHHMMSS format first before doing a DATEDIFF function?
Or is there a function(s) to convert my_date_time_field straight to a DD-MMM-YYYY HH:MM:SS or DD-MM-YYYY HH:MM:SS format?