0

I am using SmarterStats APi and one of the field in response is DateTicks and the value is in long integer 636231456000000000 I need to convert that to date and that should be today's date 2017-02-20 There is no documentation and their support is not very good.

So my question is how would a value like 636231456000000000 convert to 2017-02-20?

sam
  • 347
  • 2
  • 10
  • 26
  • 1
    Have you tested if the DateTicks is the same as .NET DateTime.Ticks? https://msdn.microsoft.com/en-us/library/system.datetime.ticks(v=vs.110).aspx – Cade Roux Feb 21 '17 at 03:16
  • It appears to be that definition. I checked it at http://tickstodatetime.com/ – Cade Roux Feb 21 '17 at 03:17
  • So How to convert that in datetime using Sql – sam Feb 21 '17 at 03:21
  • I marked this question as a duplicate of http://stackoverflow.com/questions/2313236/convert-net-ticks-to-sql-server-datetime which discusses the same issue. – Cade Roux Feb 21 '17 at 03:21
  • That didn't work . I replace the value with mine. Got an error ... The data types date and datetime are incompatible in the add operator. And after fixing the type it still failed – sam Feb 21 '17 at 03:26

0 Answers0