07-17-2023 02:00 PM
Hi all, I have next code:
When I run, I have next output: 4:03:08.000 PM 3/16/2022. Does anyone know why I have a "4" at the beginning of the output? How can I fix it?
Thanks for any help
Solved! Go to Solution.
07-17-2023 02:17 PM
What time are you expecting?
Are you using UTC time or local time?
Are you using daylight saving time?
07-17-2023 02:28 PM
Hi George,
Thanks for your help
I am using local time and also using daylight saving.
07-17-2023 02:31 PM
Your format string should be:
%<%m/%d/%Y %I:%M:%S %p>T
07-17-2023 02:34 PM
I'm not sure why it causes 4 PM but I think "%h" is wrong. Lower case h isn't listed in the format codes so it's hard to know what it's doing. Since you have 12 hour time you probably want "%<%m/%d/%Y %I:%M:%S %p>T" as your format string. %I is 12 hour time, %p grabs the AM/PM.
07-17-2023 02:45 PM
Thank you George, problem fixed. After reading help, I found %I is for 12-hours format and %p is for AM PM flag. Thank you again.
07-17-2023 02:46 PM
Thank you