Forum Discussion

HurricaneAlaine's avatar
HurricaneAlaine
Copper Contributor
Jul 02, 2022

Date and Time formatting issues

Hello, 

I am having trouble getting the Date and Time to show correctly in the table view, it is only showing in the formula bar. So, when my macro grabs the data from that cell it looks like 0.22869212962963 instead of 05:29:19.

Please help!

 

  • HurricaneAlaine 

    Apply a date format to D6, for example d-mmm-yyy, or whatever you like.

    Apply a time format to E6, for example hh:mm:ss.

     

    (Explanation: Excel stores dates and times as numbers, with a unit of 1 day. For example, 6:00 AM is stored as 6/24 = 0.25.

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        HurricaneAlaine 

        Select D6.

        On the Home tab of the ribbon, in the Number group, click on the drop-down arrow in the Number Format box, and select Short Date (or Long Date if you prefer).

        Select E6.

        This time, select Time from the Number Format drop-down.

        Result:

Resources