How to Set Current Time HH:MM PM Format

advanced-prototyping

#1

I want to display the current time in the HH:MM PM format.

Currently, I’m using “[[Now.toLocaleTimeString()]]” which is resulting in HH:MM:SS. How do I remove the SS?


#2

Hi -
Depending on your exact use-case, this might not be exactly what you’re looking for … but it accomplishes what you’re looking for…

[[0.concat(Time.substring(0,Time.length-6)).slice(-5)]]

Hope it helps!
TG


#3

Another way is to “build” the time using getHours() and getMinutes():
TimeFormatting.rp (47.6 KB)