+ Reply to Thread
Results 1 to 9 of 9

Transform date to seconds

  1. #1
    Registered User
    Join Date
    10-08-2017
    Location
    Strasbourg, France
    MS-Off Ver
    Excel 2016
    Posts
    9

    Transform date to seconds

    Hey there!

    I would like to transform date and time-data - presented in one column - (e.g. 12.04.2013 12:00) into seconds. Is there a way how I can manage this?

    Thanks for your help
    Last edited by sflany; 10-08-2017 at 12:23 PM.

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Transform date to seconds

    Quote Originally Posted by sflany View Post
    I would like to transform date and time-data - presented in one column - (e.g. 12.04.2013 12:00) into seconds. Is there a way how I can manage this?
    Number of seconds since when: 1 Jan 1970 (Unix Time, aka Universal Time); or 1 Jan 1900 (Excel time); or (gulp!) since the "beginning of time", that is: 2013 years 12 months 4 days (or do you mean 4 months 12 days?) and 12 hours?

    In any case, if A1 displays 12.04.2013 12:00, does =ISNUMBER(A1) return TRUE?

    If so, Excel recognizes that as date and time. Write one of the following:

    =ROUND((A1-1)*86400,0) for Excel time, because Excel stores date/time as days plus 1 since 1 Jan 1900

    =ROUND((DATE(1970,1,1)-A1)*86400,0) for Unix time

    The third possibility is not worth demonstrating unless you are truly interested in it. It is difficult to calculate because of the definition of leap year. And it raises some other questions.

    If =ISNUMBER(A1) is FALSE, you might try replacing A1 with SUBSTITUTE(A1,".","/") in the formulas above. But that presumes that 12/04/2013 conforms with the date convention on your computer.

  3. #3
    Registered User
    Join Date
    10-08-2017
    Location
    Strasbourg, France
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Transform date to seconds

    Thank you for your answer.
    I tried just to define the the column as [ss] for seconds and it seemed to work.

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Transform date to seconds

    Quote Originally Posted by sflany View Post
    I tried just to define the the column as [ss] for seconds and it seemed to work.
    Okay. That presents the date in seconds (since 31 Dec 1899). It does not "transform" the date into integer seconds, which is what I thought you asked for.

    But the fact that the format worked does tell us that 12.04.2013 12:00 is recognized as (numeric) Excel date/time.

  5. #5
    Registered User
    Join Date
    10-08-2017
    Location
    Strasbourg, France
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Transform date to seconds

    I am a little bit confused - what are integer seconds. Sorry for my ignorance!

  6. #6
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Transform date to seconds

    maybe in that way ?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-08-2017
    Location
    Strasbourg, France
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Transform date to seconds

    Thanks for your help. I will see which of your ideas will guide me to the goal

  8. #8
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Transform date to seconds

    Quote Originally Posted by sflany View Post
    I am a little bit confused - what are integer seconds.
    Apparently, porucha's response was useful to you. I could not make sense of it. Perhaps the following will be clearer to someone.

    A B C D E
    1
    dd.mm.yyyy hh:mm:ss
    formatted as Number
    2 12.04.2013 12:34:56 41376.5242592593 C2: =B2
    3 formatted as [ss] 3574931696 41376.5242592593 B3: =B2 C3: =B3
    4 integer seconds 3574931696 3574931696.0000000000 B4: =ROUND(B2*86400,0) C4: =B4
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-08-2017
    Location
    Strasbourg, France
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Transform date to seconds

    actually it was just a nice thank you. I will have a look at the ideas tomorrow

+ 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. Replies: 4
    Last Post: 04-30-2014, 12:42 PM
  2. [SOLVED] Transform Date 140688 into date format 14.06.88
    By inug in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-09-2013, 09:11 AM
  3. Replies: 4
    Last Post: 01-18-2010, 04:29 AM
  4. How to transform date like 19500103 to normal format?
    By toplisek in forum Excel General
    Replies: 2
    Last Post: 02-04-2008, 02:17 PM
  5. Transform text in date format
    By ina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2006, 03:35 AM
  6. [SOLVED] Number Transform to Date
    By sotiris_s in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2006, 09:30 AM
  7. Replies: 2
    Last Post: 02-17-2006, 08:15 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