Author Topic: I would like the time expressed in 12 hour format  (Read 4749 times)

mtwomey

  • Guest
I would like the time expressed in 12 hour format
« on: August 15, 2016, 10:17:27 PM »
I can get and use the time in 24 hour format {TIME:myTime} (having assigned a time stamp to myTime). I'm trying to get it into 12 hour format though. I was trying to see if I could somehow check if the timestamp was greater than 12 hours past the start of the day, but I can't seem to do that with the options available.

I'm guessing there is a different direction I could go in. I'd like to not call anything external if possible.

Any thoughts?

mtwomey

  • Guest
Re: I would like the time expressed in 12 hour format
« Reply #1 on: August 15, 2016, 10:24:48 PM »
Actually, if I could Mod (as suggested in this tooltip) I think I could do it. But I don't seem to have the mentioned dropdown - I only have "Add". Am I missing something?

http://i.imgur.com/IquN6GJ.png

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: I would like the time expressed in 12 hour format
« Reply #2 on: August 16, 2016, 12:26:39 AM »
Sorry... that's a bad tooltip (result of copying a control).  There's no Mod for time.

The help file lists a bunch of different tokens for time.  The one you are probably looking for is either
{TIMEHOUR:dateVariableName} -  The hour of the indicated date variable's time, expressed in a 12-hour clock.
or
{time:dateVariableName} - The indicated date variable's time, expressed as a 12-hour clock.

Note that, 'time' is lower-case (left over from when {TIME} and {time} were the ONLY tokens.

Hope that helps!

mtwomey

  • Guest
Re: I would like the time expressed in 12 hour format
« Reply #3 on: August 16, 2016, 08:14:32 AM »
OMG embarrassing...

I have been reading the docs quite thoroughly (especially since I just wrote a plugin). Somehow I missed that! Thank you sir :-)

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: I would like the time expressed in 12 hour format
« Reply #4 on: August 16, 2016, 09:25:31 AM »
Awesome! 

I'll rip out the tooltip and will probably amend the tokens with proper names to avoid confusion later.

Glad it was helpful!