Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8430617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:38:17+00:00 2026-06-10T05:38:17+00:00

I have a problem with processing a SQL Server database dump in PHP. I

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:38:18+00:00Added an answer on June 10, 2026 at 5:38 am

    According to the linked article in the other question linked to by Rene, SQL Server stores 3.33 millisecond intervals in the second set of 4 bytes, not milliseconds. So if you’re calculating with milliseconds, you will indeed be getting a time about 1/3 of what it should be. Using your example, let’s start by converting to decimal

    00d7f2eb -> 14152427 3.3ms intervals

    Now multiply out by 3.3 to convert to milliseconds, and divide by 1000 to get seconds

    14152427 * 3.3 / 1000 ~ 47127.58

    So this represents about 47 thousand seconds after midnight. Dividing by 3600 seconds in an hour

    47127.58 / 3600 ~ 13.091

    So this represents a time of about 13.1 hours after midnight, which agrees with the result of the cast done in SQL Server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database called ApplicationName_Development running on SQL Server 2008 R2 Developer edition
I have a C# console application, which interacts with a SQL Server Database, and
I have problem on my blog: http://osify.com while processing add new post with above
I have recently created a HTML5 canvas animation (also using Processing.js). The problem is
I am trying to import CSV file to SQL server database, with no success.
I have many .NET processes reading messages from an SQL Server 2008 DB table
We are facing a strange performance problem with SQL Server Express 2005 in a
I have a .NET class (for discussion, ClassA) that calls a SQL Server stored
I have a SQL Server that holds a lot of data. An application, running
I have set up SQL Server 2008 R2 on a Windows Server 2008 machine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.