+ Reply to Thread
Results 1 to 8 of 8

Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

  1. #1
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    Hi,

    I have a problem converting numbers in my excel sheet to dates with corresponding hours and minutes.

    Any help would be appreciated

    I've attached a sample.

    Best regards
    Attached Files Attached Files

  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,422

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    And what dates and times are you expecting to get, and why?
    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 Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    You have given not one example of what you are looking to achieve ...
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    Based on what I learned in this thread: https://www.excelforum.com/excel-for...ml#post5426932 these look like "seconds since Jan 1 1970" time stamps. Assuming that is the case, I tried a similar formula as I proposed in the other thread =CONVERT(timestamp,"sec","day")+DATE(1970,1,1) and I get a bunch of morning of 4 Jan 2021 timestamps.

    That's my guess. If I guessed wrong, help us understand exactly what these timestamps represent and we should be able to help convert them into Excel's date/time serial number system (days since 0 Jan 1900).

    Edit to add: with this assumption, 4 digits past the decimal point implies that the timestamps are to the nearest tenth of a millisecond. I seem to recall trying to format times beyond the nearest millisecond and Excel would not do it (I don't have Excel to test on right now) -- hh:mm:ss.000 was a valid number format, but hh:mm:ss.0000 was not. Can anyone with Excel handy double check?
    Last edited by MrShorty; 03-20-2021 at 09:42 AM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    That worked! Thank you very much, Mrshorty

    Sorry for not explaining the problem too well.
    Got handed an excel sheet and did not have a lot to work with - kind of like you guys.

    Anyways, I believe that did the trick.

    Best
    ExcelNick

  6. #6
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    Sorry for short explanation, had little to work with myself..

    But MrShorty solved the problem further down the thread!
    Thank you anyways

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

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    For completeness, I went ahead and tested in my older version of Excel, and confirmed that (my version) of Excel cannot display fractions of a millisecond as part of a date/time format. I note that LO Calc is not limited to milliseconds, but can display any fraction of a second (though one is eventually limited to 15 digits of double precision in the underlying serial number value).

    If you are not worried about anything past the nearest millisecond, then the solution as provided should work fine. If you ever need to be concerned with those last two digits (and the possible floating point errors in those last one to two digits), you may need to look into this a little further.

  8. #8
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Re: Converting numbers to dates, hours and minutes (10 digits before comma, 4 after)

    It is sufficient, thank you!

+ 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. converting minutes to days, hours and minutes.
    By TheGrimm in forum Excel General
    Replies: 8
    Last Post: 11-23-2015, 02:23 AM
  2. Replies: 13
    Last Post: 05-03-2013, 08:42 PM
  3. RE: Converting decimal minutes to hours, minutes and seconds
    By mills49 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-14-2013, 09:14 AM
  4. Converting large numbers to hours and minutes...
    By lhm76 in forum Excel General
    Replies: 5
    Last Post: 11-03-2010, 06:00 AM
  5. Converting hours and minutes in military time to minutes
    By Argile79 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-13-2010, 02:42 PM
  6. Error Excel converting to CSV 5+ Comma digits
    By morak in forum Excel General
    Replies: 1
    Last Post: 01-29-2009, 06:17 AM
  7. [SOLVED] Converting hours:minutes:seconds to just minutes
    By Dan Vagle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2006, 06:25 PM
  8. [SOLVED] converting Days Hours & minutes into just minutes in excel
    By Six Sigma Blackbelt in forum Excel General
    Replies: 5
    Last Post: 04-28-2006, 04:45 PM

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