Results 1 to 6 of 6

Thread: Opposite of DateAdd

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Rasm, I do not intend to question the sanctity of the theories in that site, however, I know for sure that if you convert a date time value in Excel to its value, the number returned will be equivalent to the number of days starting from 1/1/1900 0:00:00, inclusive of all leap years and leap seconds.

    So based on my theory, 10/27/2011 12:01:51 AM will be converted to 40843.00128 (days) which means 40843.00128*3600*24 seconds = 3528835311 seconds

    Now, if you reverse this to date, using a simple text function like so =TEXT(D1,"m/d/yyyy h:mm:ss AM/PM"), you would get the original date 10/27/2011 12:01:51 AM

    If you are still confused, I can prove it with an attachment
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    15
    You are absolutely correct - however I am reading my date stamps as long integers from a Binary file - using random access -- along with a bunch more info - next I manipulate my data in Excel - next I write back to the binary file - But now have to leave a date/time stamp of my modification. So this is where I need to convert the Date/time stamp into a long integer. The binary files are originally written by C++ code.

    So the example you shown me above - I will use that - all I have to do is subtract an offset in seconds to represent thetime period 1900 to 1980.

    So this I will test - thank you very much.
    Last edited by Rasm; 10-27-2011 at 02:41 AM.
    xl2007 - Windows 7
    xl hates the 255 number

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •