0

In a SQL Server Database, I have some data relative to date and times stored. I have two columns : StartTime and EndTime, which contains two values :

635193180000000000

into StartTime and

635193216000000000

into EndTime.

I have searched how to convert this into "classic time" like "September 04th 2013" but it is not Unix time and I don't know which format it is..?

Jeremy
  • 1,746
  • 1
  • 15
  • 20
Alex
  • 863
  • 1
  • 9
  • 15

2 Answers2

2

Finally found the solution thanks to this question : Convert specific BigInt to DateTime in T-SQL .

It uses .NET Ticks, which begins from 01-01-1900 midnight.. Different from standard UNIX time !

So 635193180000000000 gives 2013-11-06​ 07:00:00.000 .

Alex
  • 863
  • 1
  • 9
  • 15
0

try using this:-

select dateadd(s, convert(bigint, 1283174502729) / 1000, convert(datetime, '1-1-1970 00:00:00'))
Tejinder Singh
  • 1,070
  • 2
  • 8
  • 24