Send 12-hour format for HOUR

Discussion, questions and support.
Post Reply
TokyoMike
Posts: 35
Joined: May 10th, ’18, 07:01

Post by TokyoMike » Mar 1st, ’21, 07:53

Q1: Hi - how do I send %A_Hour% for 12-hour time? I need the time to be 04 for 4pm. I have seen how I can create a macro using h for 12-hour time, but if I type hh I get 24-hour time. Can I somehow display a leading 0?
A2: Do I need to use an if condition for this?


Q2:I also need to send this: {{sometext}} - but I am getting nothing as I think the tool is trying to interpret this as a command. Can I escape the { and } characters?
A2: Well I sorted out the second part - just "escape" the { and } characters like so {{} {}}
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Mar 1st, ’21, 10:43

You need to use a Date and Time macro with the following
Format: hh

hh - Hours with leading zero; 12-hour format
TokyoMike
Posts: 35
Joined: May 10th, ’18, 07:01

Post by TokyoMike » Mar 1st, ’21, 10:46

Marko wrote: Mar 1st, ’21, 10:43 You need to use a Date and Time macro with the following
Format: hh

hh - Hours with leading zero; 12-hour format
I tried that and it printed 16 instead of 04!
You are correct, apologies. If I limit the macro to hh only, it is correct. if I try hh:mm then it switches to 24-hour time.

I did get a conditional to put a 0 based on the time - but I think I will use hh by itself - thanks.

One question - where do these macro's end up? I have created several and I cannot find them in the tool - are they stored somewhere?
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Mar 1st, ’21, 13:44

Try hh':'mm ;)

You can check the formats in the docs:
https://www.fastkeysautomation.com/docu ... dTime.html

All settings and macros are stored in the Settings.fdb file.
Post Reply