USE mdbSELECT ref_num, dbo.secs2date(open_date) as open_date FROM call_req
By Jerome Mayer
SET QUOTED_IDENTIFIER OFFGOCREATE FUNCTION dbo.secs2date(@numSeconds bigint)returns varchar(20)as begin return convert(varchar(20), dateadd(ss, @numSeconds, '01-01-1970 00:00:00'), 101)endGO
[dbo].[secs2date]
select DATEADD(ss, open_date, '19700101') UTCDatefrom call_req
How to convert using javascript:
CA PAM::.Javascript::. getTime() Method
Summary CA SDM MS SQL Querys - TSQL
CABI4::. - BOXI - Web Intelligence - Date Formats - How to change date formats - Como formatar datas
For eveyone's information.
The converted time will be UTC.
It means you will need to manage your local timezone, and daylight saving time if appicable.
Look at T-SQL Toolbox - Home if you need to handle DST and Timezone