system.date.format('HH') Gives Hour in AM/PM not 0-23

I am using system.date.format(startDate,'yyyy_MM_dd_HHmm'). It is currently 15:36 but I am getting 2025_10_13_0336 instead of 2025_10_13_1536. Why?

My startDate comes from an expression function dateArithmetic(now(), -12, "hr")

1 Like

Are you in a -12hr timezone?

Central time.

I get the correct time when I use system.date.now()

I had my start date and end date backwards - I can never keep them straight. End date is -12 hours. That explains it

2 Likes