RE: Epoch time to SQL datetime conversion

RE: Epoch time to SQL datetime conversion

 

  

Here you go!!

CREATE FUNCTION ufnEpochSec2Date
(@epochseconds char(255))
RETURNS DATETIME
AS
BEGIN
RETURN dateadd(s, convert(int, @epochseconds), '01-01-1970')
END

--SELECT dbo.ufnEpochSec2Date ('2147000000')


Regards,
Uday
.....................................
Direct: +61-2-98059739
Mobile: +61-401 705907
Email: [Email address protected]


-----Original Message-----
From: Carl [mailto:mssqldba-ezmlmshield-x63333915.[Email address protected]
Sent: Thursday, 28 April 2005 10:56 PM
To: LazyDBA Discussion
Subject: Epoch time to SQL datetime conversion





Hello all,

Does anyone know of an easy way to convert from Epoch time to a SQL
datetime format?

Epoch Time to DateTime
1114059600 4/21/2005 12:00:00 AM


Carl Phillips
Regions Bank
I.S. Engineer
Proactive Monitoring and Problem Management
W 334-956-6169
C 334-799-8632
800-272-2867


--------------------------------------------
This e-mail and any files transmitted with it are the property of
Regions Financial and/or its affiliates, are confidential, and are
intended solely for the use of the individual or entity to whom
this e-mail is addressed. If you are not one of the named
recipient(s) or otherwise have reason to believe that you have
received this message in error, please delete this message
immediately from your computer. Any other use, retention,
dissemination, forwarding, printing, or copying of this e-mail
is strictly prohibited.



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]


MS Sql Server LazyDBA home page