Results 1 to 2 of 2

Thread: Time and date to string

  1. #1

    Time and date to string

    Register for a FREE account, and/
    or Log in to avoid these ads!

    I have a number of cells that have date format. I'm interested in getting this in milli seconds but just to 2 decimal place.
    e.g 07/10/2015 08:14:52.60
    What i need to be able to do is put this information into a string so i can extract it exactly to 2 decimal places, and not the numerical equivalent (below)

    any thoughts on how best to approach this?
    I know it sounds a big deal but i will be using a vwap command further down the line.

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Excel Version
    on a sheet where L26 contains your date/time of 42,284.3436644213000 (formatted or not to display as date):
    =TEXT(L26,"dd/mm/yyyy hh:mm:ss.00")
    yields 07/10/2015 08:14:52.61

    in vba, a copy of the immediate pane in the VBE:
    ?[text(42284.3436644213000,"dd/mm/yyyy hh:mm:ss.00")]
    07/10/2015 08:14:52.61

    the format function didn't work:
    ?format(42284.3436644213000,"dd/mm/yyyy hh:mm:ss.00")
    07/10/2015 08:14:53.00

Posting Permissions

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