It is currently June 25th, 2019, 12:26 am

How do I change this 24 hour clock to 12 hour?

Help with creating, editing & fixing problems with skins
brave
Posts: 1
Joined: April 27th, 2019, 12:24 am

How do I change this 24 hour clock to 12 hour?

brave » April 27th, 2019, 12:30 am

title says it all

Code: Select all

[MeasureTime]
Measure=Time
Format=%R

[MeasureDate]
Measure=Time
Format=%d

[MeasureTimeampm]
Measure=Time
Format=%p

[MeasureTimeS]
Measure=Time
Format=%S

[MeasureMonth]
Measure=Time
Format=%B
Substitute="January":"JANUARY","February":"FEBRUARY","March":"MARCH","April":"APRIL","May":"MAY","June":"JUNE","July":"JULY","August":"AUGUST","September":"SEPTEMBER","October":"OCTOBER","November":"NOVEMBER","December":"DECEMBER"

[MeasureDay]
Measure=Time
Format=%A
Substitute="Monday":"MONDAY","Tuesday":"TUESDAY","Wednesday":"WEDNESDAY","Thursday":"THURSDAY","Friday":"FRIDAY","Saturday":"SATURDAY","Sunday":"SUNDAY"
can somebody help? thanks :)
Last edited by balala on April 27th, 2019, 7:39 am, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3371
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How do I change this 24 hour clock to 12 hour?

eclectic-tech » April 27th, 2019, 2:44 am

You can do it by changing the [MeasureTime] line Format=%R to Format=%r.

You can use any combination of these Time Format codes to control how the time is displayed:
%H: Hour in 24-hour format (00 - 23)
%I: Hour in 12-hour format (01 - 12)
%M: Minute as number (00 - 59)
%p: AM/PM indicator for 12-hour clock
%r: Full 12-hour clock time. (e.g. "10:55:03 pm")
%R: 24-hour HH:MM clock time. (e.g. "22:55")
%S: Second as number (00 - 59)

I am not sure how your skin is using [MeasureTimeampm] since the time was set for 24 hour display; you may need to change other things if you end up with double AM/PM indications on the time display.
ms310
Posts: 99
Joined: April 1st, 2015, 7:16 am

Re: How do I change this 24 hour clock to 12 hour?

ms310 » April 27th, 2019, 2:46 am

Hi -

I am no expert, but I tinker with a lot of time and weather skins.

The docs for Rainmeter are really awesome, with examples: https://docs.rainmeter.net/manual/measures/time/

In this link you will see the following two entries:
%r: Full 12-hour clock time. (e.g. "10:55:03 pm")
%R: 24-hour HH:MM clock time. (e.g. "22:55")
In your case your current code is using %R for the format code. Change it to %r and see if that does the trick.

Hope it helps!