+ Reply to Thread
Results 1 to 5 of 5

Epoch Converter

  1. #1
    Forum Contributor
    Join Date
    07-22-2013
    Location
    london
    MS-Off Ver
    Excel 2013
    Posts
    133

    Epoch Converter

    We have this number 1638979200 using block.timestamp and we want to know the time and date using a formula.

    The datetime for the number 1638979200 is 12/8/21 13:00:00

    What would be the formula?


    NM, solved it. The formula is:
    =(((A1/60)/60)/24)+DATE(1970,1,1)-TIME(3,0,0)

    There was a 3 hours offset because of the timezones.
    Last edited by nicoan; 12-08-2021 at 10:01 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Epoch Converter

    See: https://www.epochconverter.com/

    Microsoft Excel / LibreOffice Calc =(A1 / 86400) + 25569 Format the result cell for date/time, the result will be in GMT time (A1 is the cell with the epoch number). For other time zones: =((A1 +/- time zone adjustment) / 86400) + 25569.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,825

    Re: Epoch Converter

    Do you know what this number represents? Excel's date/time serial number system is based on "days since midnight on the morning of 0 Jan 1900". The other system I see is based on "time (usually seconds) since midnight on the morning of 1 Jan 1970." If I assume this latter for this number, =CONVERT(1638979200,"sec","day")+DATE(1970,1,1) results in 44538 2/3 or 4 PM on dec 8 2021. At this point, I am guessing that your number represents seconds since 1 Jan 1970 for a specific time zone (maybe UTC??). A formula like I used (adding an adjustment for time zone) should work.

    Am I guessing correctly?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: Epoch Converter

    I believe I have it....
    Please Login or Register  to view this content.
    the -0.125 adjusts for 4 hours (which I believe is a time zone conversion.
    * I started with a blank worksheet and in cell A1 i Have your long number of '1638979200'. Next the part of the formula upto and EXCLUDING the time conversion ( '-0.125' ) is the conversion for your formula.
    I believe that Unix uses Jan 1, 1970 as its start date.
    The number 86400 is the number of seconds in a Day.
    Please test this out on other dates, as I do not have the luxury of a Unix Epoch timestamp handy. Also, please give reputation if this helped in any way. Cheers!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Epoch Converter

    Again, see the link.

    What is epoch time?

    The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a synonym for Unix time. Some systems store epoch dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the Year 2038 problem or Y2038). The converter on this page converts timestamps in seconds (10-digit), milliseconds (13-digit) and microseconds (16-digit) to readable dates.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] convert epoch timestamp to EDT?
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2017, 11:24 AM
  2. [SOLVED] EPOCH Time Conversion to local time and daylight savings time (DST)
    By cwwazy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2015, 02:14 PM
  3. How to convert Epoch date in Excel
    By Terressa in forum Excel General
    Replies: 2
    Last Post: 07-10-2015, 04:12 AM
  4. TLE EPOCH to UTC conversion
    By student1945 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-30-2012, 07:03 AM
  5. Converter
    By burak in forum Excel General
    Replies: 0
    Last Post: 05-09-2012, 10:56 AM
  6. [SOLVED] converter
    By recipe type data in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 04-04-2006, 08:20 PM
  7. PDF Converter
    By AccessHelp in forum Excel General
    Replies: 4
    Last Post: 01-07-2006, 10:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1