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 189849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:12:25+00:00 2026-05-11T16:12:25+00:00

I have DateTime structure for an old data format that I don’t have access

  • 0

I have DateTime structure for an old data format that I don’t have access to any specs for. There is a field which indicates the datetime of the the data, but it isn’t in any format I recognize. It appears to be stored as a 32-bit integer, that increments by 20 for each day. Has anyone ever run across something like this?

EDIT:

Example: 1088631936 DEC = 80 34 E3 40 00 00 00 00 HEX = 09/07/2007

EDIT:

First off, sorry for the delay. I had hoped to do stuff over the weekend, but was unable to.

Second, this date format is weirder than I initially thought. It appears to be some sort of exponential or logarithmic method, as the dates do not change at an increasing rate.

Third, the defunct app that I have for interpreting these values only shows the date portion, so I don’t know what the time portion is.

Example data:
(Hex values are big-endian, dates are mm/dd/yyyy)

0x40000000 = 01/01/1900
0x40010000 = 01/01/1900
0x40020000 = 01/01/1900
0x40030000 = 01/01/1900
0x40040000 = 01/01/1900
0x40050000 = 01/01/1900
0x40060000 = 01/01/1900
0x40070000 = 01/01/1900
0x40080000 = 01/02/1900
0x40090000 = 01/02/1900
0x400A0000 = 01/02/1900
0x400B0000 = 01/02/1900
0x400C0000 = 01/02/1900
0x400D0000 = 01/02/1900
0x400E0000 = 01/02/1900
0x400F0000 = 01/02/1900
0x40100000 = 01/03/1900
0x40110000 = 01/03/1900
0x40120000 = 01/03/1900
0x40130000 = 01/03/1900
0x40140000 = 01/04/1900
0x40150000 = 01/04/1900
0x40160000 = 01/04/1900
0x40170000 = 01/04/1900
0x40180000 = 01/05/1900
0x40190000 = 01/05/1900
0x401A0000 = 01/05/1900
0x401B0000 = 01/05/1900
0x401C0000 = 01/06/1900
0x401D0000 = 01/06/1900
0x401E0000 = 01/06/1900
0x401F0000 = 01/06/1900
0x40200000 = 01/07/1900
0x40210000 = 01/07/1900
0x40220000 = 01/08/1900
0x40230000 = 01/08/1900
….
0x40800000 = 05/26/1901
0x40810000 = 06/27/1901
0x40820000 = 07/29/1901
….
0x40D00000 = 11/08/1944
0x40D10000 = 08/29/1947

EDIT: I finally figured this out, but since I’ve already given up the points for the bounty, I’ll hold off on the solution in case anyone wants to give it a shot.

BTW, there is no time component to this, it is purely for storing dates.

  • 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-05-11T16:12:25+00:00Added an answer on May 11, 2026 at 4:12 pm

    It’s not integer, it’s a 32 bit floating point number. I haven’t quite worked out the format yet, it’s not IEEE.

    Edit: got it. 1 bit sign, 11 bit exponent with an offset of 0x3ff, and 20 bit mantissa with an implied bit to the left. In C, assuming positive numbers only:

    double offset = pow(2, (i >> 20) - 0x3ff) * (((i & 0xfffff) + 0x100000) / (double) 0x100000);
    

    This yields 0x40000000 = 2.0, so the starting date must be 12/30/1899.

    Edit again: since you were so kind as to accept my answer, and you seem concerned about speed, I thought I’d refine this a little. You don’t need the fractional part of the real number, so we can convert straight to integer using only bitwise operations. In Python this time, complete with test results. I’ve included some intermediate values for better readability. In addition to the restriction of no negative numbers, this version might have problems when the exponent goes over 19, but this should keep you good until the year 3335.

    >>> def IntFromReal32(i):
            exponent = (i >> 20) - 0x3ff
            mantissa = (i & 0xfffff) + 0x100000
            return mantissa >> (20 - exponent)
    
    >>> testdata = range(0x40000000,0x40240000,0x10000) + range(0x40800000,0x40830000,0x10000) + [1088631936]
    >>> from datetime import date,timedelta
    >>> for i in testdata:
            print "0x%08x" % i, date(1899,12,30) + timedelta(IntFromReal32(i))
    
    
    0x40000000 1900-01-01
    0x40010000 1900-01-01
    0x40020000 1900-01-01
    0x40030000 1900-01-01
    0x40040000 1900-01-01
    0x40050000 1900-01-01
    0x40060000 1900-01-01
    0x40070000 1900-01-01
    0x40080000 1900-01-02
    0x40090000 1900-01-02
    0x400a0000 1900-01-02
    0x400b0000 1900-01-02
    0x400c0000 1900-01-02
    0x400d0000 1900-01-02
    0x400e0000 1900-01-02
    0x400f0000 1900-01-02
    0x40100000 1900-01-03
    0x40110000 1900-01-03
    0x40120000 1900-01-03
    0x40130000 1900-01-03
    0x40140000 1900-01-04
    0x40150000 1900-01-04
    0x40160000 1900-01-04
    0x40170000 1900-01-04
    0x40180000 1900-01-05
    0x40190000 1900-01-05
    0x401a0000 1900-01-05
    0x401b0000 1900-01-05
    0x401c0000 1900-01-06
    0x401d0000 1900-01-06
    0x401e0000 1900-01-06
    0x401f0000 1900-01-06
    0x40200000 1900-01-07
    0x40210000 1900-01-07
    0x40220000 1900-01-08
    0x40230000 1900-01-08
    0x40800000 1901-05-26
    0x40810000 1901-06-27
    0x40820000 1901-07-29
    0x40e33480 2007-09-07
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 86k
  • Answers 86k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I have experienced the same problem. We have a large… May 11, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer 0xF == 15. It's simply hexadecimal notation. However, that snippet… May 11, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer Yes you can do this. Elixir doesn't have a built… May 11, 2026 at 5:20 pm

Related Questions

I have a legacy C++-based application that timestamps incoming network traffic using the CRT
I have a range of dates and a measurement on each of those dates.
I'm working on an asp.net-mvc application. The linq data context is being passed into
I'm trying to write a query that will pull back the two most recent
I've got a strange problem with SQL Server 2000, and I just can't think

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.