Notify Pushover time %now% doesn't show am/pm

I have a notification in a rule:
Notify Pushover Mailbox Notification: 'Mailbox open at %now%(Mailbox open at 10:19)'
But the result does not indicate am or pm on the time, which can be confusing. Is there any way to indicate it in HE apps? Or is %now% a part of the Pushover product?

I just checked this out in RM and Notifier.
I got another dialog box in RM that asks you about format.
I didn't get anything in Notifier, not that it wasn't there, somewhere. :slight_smile:

I personally never use this because Pushover gives you the time.

Yeah, I just noticed that it puts the timestamp on the notification so I guess I can live with it. And I did notice the format box preceding the action edit page. I wonder why a few of the formats appear to be duplicates?

Can you just check the time then append AM or PM to the notice?

IF (Time between 12:00 AM and 12:00 PM) THEN
    Notify Pushover Mailbox Notification:  'Mailbox open at %now% AM'
ELSE
    Notify Pushover Mailbox Notification:  'Mailbox open at %now% PM'
END-IF
1 Like

I just use %time% and it works fine. I didn't even know about %now%

2 Likes

It looks like duplicates for double digit hours but it's different when they're single digits.

1 Like

@pseudonym beat me to it. When formatting output of a date we use format templates.
for 12 hr format it is (i'm using minutes just for readibility and a 9am example):
h:mm - thats no leading zero 9:00
hh:mm - results in 09:00
24 hr format is
H:mm 9:00.
HH:mm - results in 09:00.

See my date/time parser tool both for examples as well as a way to generated your own format.
Here's a hopefully useful table :slight_smile: // pattern definitions
dTDayNamePattern = new SimpleDateFormat('EEEE')
dTDayNameText3Pattern = new SimpleDateFormat('EEE')
dTDayOfMonNumPattern = new SimpleDateFormat('dd')
dTDayOfMonNumNoLeadPattern = new SimpleDateFormat('d')
dTDayOfWeekNumPattern = new SimpleDateFormat('u')
dTDayOfYearNumPattern = new SimpleDateFormat('D')
dTDaysInMonthNumPattern = new SimpleDateFormat('MMMM')
dTMonthNamePattern = new SimpleDateFormat('MMMM')
dTMonthNameText3Pattern = new SimpleDateFormat('MMM')
dTMonthNumPattern = new SimpleDateFormat('MM')
dTMonthNumNoLeadPattern = new SimpleDateFormat('M')
dTYearNum4DigPattern = new SimpleDateFormat('yyyy')
dTYearNum2DigPattern = new SimpleDateFormat('yy')
dTTimeHour12NumPattern = new SimpleDateFormat('hh')
dTTimeHour24NumPattern = new SimpleDateFormat('HH')
dTTimeHour12NumNoLeadPattern = new SimpleDateFormat('h')
dTTimeHour24NumNoLeadPattern = new SimpleDateFormat('H')
dTTimeMinNumNoLeadPattern = new SimpleDateFormat('m')
dTTimeMinNumPattern = new SimpleDateFormat('mm')
dTTZIDPattern = new SimpleDateFormat('zzzz')
dTTZIDText3Pattern = new SimpleDateFormat('z')
dTGMTDiffHoursPattern = new SimpleDateFormat('Z')
dTTimeAntePostUpperPattern = new SimpleDateFormat('a')
dTTimeAntePostLowerPattern = new SimpleDateFormat('a') //drop to lower case using temp value
dTWeekOfMonNumPattern = new SimpleDateFormat('W')
dTWeekOfYearNumPattern = new SimpleDateFormat('w')

I"m using SimpleDateFormat because the libraries of HE are based on old 2.4 Groovy and don't support Java's newest libraires (to my knowledge)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.