+ Reply to Thread
Results 1 to 3 of 3

String format to Time format

  1. #1
    Registered User
    Join Date
    10-17-2019
    Location
    Brno
    MS-Off Ver
    2016
    Posts
    1

    String format to Time format

    Greetings, I'm new and my question is very simple but I'm not able to find a solution.

    I have a string that I extracted from IPCam log in this format: "01:24:02.455". This is the original format. And now, I need to convert this into time format like "hh:mm:ss:ms" for another operations.

    Here is my solution:

    1) separate ":" and "." I'll get "012402455" it's a number in string format, right? But what to do now? How to convert into Date(time) format 01:24:02:455? I tried something like CDate and so on. But without correction.

    I need to find an algorithm that can convert lots of string numbers into Date (time) format for operations that helps me determinate differences between two time.

    For example:

    I have a data log that says to me: IP cam lost signal in 01:24:02.455 and IP signal was connected in 01:24:03.810. and I need to extract with precision the right time. So my answer will be: the IP cam was disconnected for 00:00:01:355

    I am not sure if the right format could be "hh:mm:ss:ms" or "hh:mm:ss.ms"? What is the right format?

    Thanks a lot for your help in this very very strange piece...

  2. #2
    Registered User
    Join Date
    11-06-2012
    Location
    Texas
    MS-Off Ver
    O365
    Posts
    27

    Re: String format to Time format

    The worksheet function Timevalue() should handle that for you. It will convert "01:23:45.678" into 0.0581675694444444 decimal days.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: String format to Time format

    You can just use this formula to convert a string in that format which is in cell A2:

    =VALUE(A2)

    and you can apply a Custom Format of hh:mm:ss.000 to display it accordingly.

    Hope this helps

    Pete

+ 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] How to subtract 1 hour from a 24hour time in string format value?
    By egotajcs in forum Excel General
    Replies: 19
    Last Post: 05-24-2017, 03:02 AM
  2. Automatically entering : when I type a string of 4 numbers military time format.
    By ibeesda1Udontknow2 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-19-2013, 12:56 AM
  3. [SOLVED] Need UDF to return time format from string input
    By Andrew_Harris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2012, 09:59 PM
  4. Translating an inconsistent text string to time format.
    By graveyardshiftee in forum Excel General
    Replies: 2
    Last Post: 02-21-2012, 05:42 AM
  5. How do I convert a text string to a time format
    By knighttrader in forum Excel General
    Replies: 8
    Last Post: 01-29-2008, 04:19 AM
  6. [SOLVED] Excel date format convert to string format
    By man in forum Excel General
    Replies: 1
    Last Post: 08-17-2006, 05:05 AM
  7. Converting text string to a its proper time format
    By Edmund Wong in forum Excel General
    Replies: 3
    Last Post: 10-20-2005, 08:05 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