Hanfire_State table {"EnqueueAt":"1584013200000","ScheduledAt":"1583840392975"} Data Types?

Hi!

Whan data type in Hangifire_State ar EnqueueAt and ScheduledAt

I’m trying to query database directly for project issues but can’t figure out what timespan are both dates

Thanks in advance

I am not associated with Hangfire, but from looking through the source code, I believe this number (such as “1588651278053”) is the number of milliSeconds since the base (or “epoch”) date of 1-Jan-1970.

In Microsoft SQL Server, in theory, you could use the DATE_ADD function to add this number of milliSeconds to the “1-Jan-1970” base date to find the corresponding date/time; however, the DATE_ADD function only accepts “int” values, and the number above will cause an overflow error.

Alternatively, you could split the number into a “seconds” value and “milliSeconds” value (“1588651278” and “053” for the number shown on the first line above), and then derive the corresponding date as follows using the DATE_ADD function twice to sequentially add the “Seconds” and “milliSeconds” values:

SELECT DATEADD(ms,53,DATEADD(s,1588651278,‘1-Jan-1970’));

This produces the corresponding date/time of “2020-05-05 04:01:18.053” for this numeric value.