I want to be able to display a 12 hour clock on a config that I am building. What would be the best way to do that? For example:
0800 would be 8:00 AM while 1600 would be 4:00 PM
Thanks!
12 hour clock on 450
- highlandranger
- Posts: 3
- Joined: Fri Aug 05, 2011 3:17 pm
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: 12 hour clock on 450
Hello highlandranger,
You are going to need to create two user variables.
One to hold the hours from 1 -12 and calculate it like this:
You can display this variable with a text gauge.
And another one to know if it is AM or PM and calculate it like this:
You can use this variable for the visible condition of "AM" and "PM" text widgets.
*EDIT
You don't even need the second variable, the visible conditions for "AM" and "PM" can look at the "RealTimeClock.Hour" variable directly.
Regards,
ksaenz
You are going to need to create two user variables.
One to hold the hours from 1 -12 and calculate it like this:
Code: Select all
mod("RealTimeClock.Hour"+11, 12) + 1
And another one to know if it is AM or PM and calculate it like this:
Code: Select all
if("RealTimeClock.Hour">11, 1, 0)
*EDIT
You don't even need the second variable, the visible conditions for "AM" and "PM" can look at the "RealTimeClock.Hour" variable directly.
Regards,
ksaenz