It is currently April 27th, 2024, 12:53 pm

Remove time hour zero when using %r time

Get help with creating, editing & fixing problems with skins
User avatar
JohnBurns
Posts: 63
Joined: February 11th, 2011, 4:18 pm
Location: Oklahoma City

Remove time hour zero when using %r time

Post by JohnBurns »

Is there a way to remove the "0" in the hour when using %r time in a skin? I know %#I or %#H works but what do i do with %r? %#r does not seem to work. What's the trick? Appreciate any help. Thanks.
Windows 10 Version 20H2 (OS Build 19042.870)
44))Realtime: Windows Defender, McAfee Total Access-Total Protection, Malwarebytes, WiseVector, HMP Alert, UAC Highest Level
OnDemand: Adwcleaner, MRT, Emsisoft EEK
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Remove time hour zero when using %r time

Post by jsmorley »

Code: Select all

[MeasureTime]
Measure=Time
Format=%r
RegExpSubstitute=1
Substitute="^0":""
^ Just means "beginning of the string" in Regular Expression.

Having said that, I'm not sure I see any advantage to %r over %#I:%M:%S %p to be honest.
User avatar
JohnBurns
Posts: 63
Joined: February 11th, 2011, 4:18 pm
Location: Oklahoma City

Re: Remove time hour zero when using %r time

Post by JohnBurns »

Thanks for the fast reply - appreciate your help and all your work in Rainmeter.
Windows 10 Version 20H2 (OS Build 19042.870)
44))Realtime: Windows Defender, McAfee Total Access-Total Protection, Malwarebytes, WiseVector, HMP Alert, UAC Highest Level
OnDemand: Adwcleaner, MRT, Emsisoft EEK