Forum Academy Marketplace Showcase Pricing Features

Weird time display issue (wrong time displays when custom format used)

I have a time stored in the database:

“01/05/2022 06:30 pm”

I call this in a text box as a date using the custom format “mmm d yyyy, h:mmtt”

It then displays “Jan 5 2022, 6:01pm”

(note the minutes are incorrect; displays 01 instead of 30)

If I do not use a custom format and choose to just display hh:mm, it will correctly display at 18:30.

Does anybody have an explanation for this behaviour? Seems like a bug!


Solution: I just got this to work using the format mmm d yyyy, h:MMtt

It seems capitalising the minutes makes a difference? Does anybody know why this is? My guess is that low case mm, means round down? Seems odd that this should display as 01 though?

mm means Month (hence 01 for January)

MM is minutes

1 Like

Doh! Seems so obvious now! Thanks for this :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.