Forum Discussion

alexx1202's avatar
alexx1202
Copper Contributor
Jun 10, 2023

Need to change date/time format on 2 columns of data

How do I format the date and time shown in the columns boxed in red to display like the one boxed in green? (Refer to pics)

 

I want both columns to look like e.g 24/11/2009  9:32:00 PM not 2009.11.24 21:32:00.

 

Thanks

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    alexx1202 The date/time stamps in the first picture seem to be real time values that are custom formatted to display the way they do. So, these you can easily change simply by choosing the time format you want, for instance dd/mm/yyyy hh:mm:ss am/pm

     

    In the other picture the date/time stamps seem to be texts, so you need to change them to date values first. Dates are in fact numbers counting from 1 for 1 Jan 1900. So, 24 Nov 2009 is actually day number 40141. And the time 21:32:00 is represented as a fraction of a 24 hour day, thus, 0.897222222222222. Put them together to get a date/time value of 40141.897222222222222.

     

    Use Text-to-columns on the Data ribbon to transform the texts to date/time values. Select the range of dates in column E. Then, Data, Text to columns and just press Finish. Repeat for column I. Now you should have date/time values formatted in the default date/time format for your system. Change the  format as you wish as described above.

     

Resources