Forum Discussion
JingHerTan-5841
7 years agoCommunity Member
Javascript for 12 hour clock
Hi everyone, does anyone know how to display a clock in 12 hour format like the one shown in the image below? So far I have only found the javascript for displaying clock in 24 hour format from ...
Hey Daniel (or any Javascript experts out there).
That script just there is perfect and it works beautifully for my interface demo which will show the user's current time as they interact with the module.
However, I have a request to show time-based information within the display and I was wondering how could this be adjusted to have a variable display, say, 4 minutes earlier than the current time? Like in a text message timeline, for example.
4.36PM: Diarmaid wrote this.
%12Hour%: Diarmaid wrote this.
4.32PM: Diarmaid thought about writing this.
%12Hour_Minus4Mins%: Diarmaid thought about writing this.
I thought I could just use some mathematics but realised that it's a text string variable so I am stumped.