I have a problem with processing a SQL Server database dump in PHP.
I have one column called datatime
with values like :
0x0000a0af00d7f2eb
I need to extract, in PHP, the date and time values of this column. I don't have SQL Server available so I can't use the obvious solution of CAST(0x0000a0af00d7f2eb AS datetime)
.
Someone has told me that this hex: 0000a0af00d7f2eb
is created by 4 bytes of date and 4 bytes of time.
So I know that:
When I will change 0000a0af
(first 4 bytes) to decimal I will get number of days from 1900. That works fine.
But when I'm trying to change last the 4 bytes (so there should be time) : 00d7f2eb
to decimal I'm getting something which I can't understand. It should be a time from midnight in milliseconds and sometimes this value is ~3 times lower.
Could anyone help in converting 0000a0af00d7f2eb
to date? I know that time is between 5 AM and 11 PM, and the day is in last week.