How the record "nDateTime" in table TB_EVENT_LOG is written?
I have this SQL Database, the record nDateTime in TB_EVENT_LOG Table is saved in a way that I cant understand, can anyone tell me how it is saved so I can read it-
In the Views -->IBA_Transactions...I cant read all the records clearly "Date-Time"
I attach the database, just unzip and add the ext .bak
Thanks 2014.zip
Microsoft SQL ServerMicrosoft SQL Server 2008
Last Comment
Habib Pourfard
8/22/2022 - Mon
Habib Pourfard
instead of storing datetime values, they are storing seconds since 1970-01-01. as you can see in the view you need to decode it:
SELECT TOP 1000 [nEventLogIdn] , CONVERT(NVARCHAR(32), DATEADD(s, TB_EVENT_LOG.nDateTime, '1970-01-01'), 111) AS [Date] , CONVERT(NVARCHAR(32), DATEADD(s, TB_EVENT_LOG.nDateTime, '1970-01-01'), 108) AS [Time]FROM [BioStar].[dbo].[TB_EVENT_LOG]
Open in new window
I have no idea why they are storing date data as int instead of datetime.