It is currently April 27th, 2024, 6:22 am

Time format issue after converting analog clock to digital

Get help with creating, editing & fixing problems with skins
paul1965
Posts: 11
Joined: March 7th, 2024, 4:44 pm

Time format issue after converting analog clock to digital

Post by paul1965 »

Hello all. I'm new to Rainmeter, having jumped from XWidget after a server shutdown killed all of the weather skins.

I have started using the Weather Time Bar skin by xenium and I really like it. I have made some changes to it though to better suit my needs, like moving the date and time to the far left, then shifting the weather data over to the right. I've also updated analog clock to a digital one, but I'm stumped on getting the format correct. Right now it's stuck on HH:MM:SS and I can't seem to find where the format code is listed. In my code, If I insert formatting (%#I:%M %p) in weatherbar.ini under "MeasureTime", I can get the formatting to match my needs, but then the clock doesn't update at all. If I comment the formatting out, the clock updates fine but then still displays as HH:MM:SS.

I've searched through all of the .inc files with no luck. Is there a master time format buried somewhere that I'm just not finding? Any help would be greatly appreciated!
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Time format issue after converting analog clock to digital

Post by Yincognito »

There's nothing buried anywhere, everything relevant to your objective is in the same file. However, in this case we can't know for sure what you actually did until we see the code.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
paul1965
Posts: 11
Joined: March 7th, 2024, 4:44 pm

Re: Time format issue after converting analog clock to digital

Post by paul1965 »

Here's the code I have in the .ini file:

Code: Select all

[MeasureTime]
Measure=Time
IfCondition=(MeasureTime % 60) = 0
IfTrueAction=[!UpdateMeter MeterTime]
;Format=%I:%M %p<-------------------------This will format the clock, but it fails to update
;IfTrueAction=[!UpdateMeter MeterMinutesHand]

Meter:

[TextStyle]
FontFace=#FontFace#
FontColor=#FontColor#
SolidColor=0,0,0,1
StringStyle=Bold
StringAlign=Right
AntiAlias=1

[MeterTime]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureTime
X=235
Y=80
FontSize=15
;Format=%I:%M %p<-------------------Formatting here has no affect
Last edited by balala on March 7th, 2024, 6:56 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
User avatar
xenium
Posts: 867
Joined: January 4th, 2018, 9:52 pm

Re: Time format issue after converting analog clock to digital

Post by xenium »

paul1965 wrote: March 7th, 2024, 6:11 pm Here's the code I have in the .ini file:

[MeasureTime]
Measure=Time
IfCondition=(MeasureTime % 60) = 0
IfTrueAction=[!UpdateMeter MeterTime]
;Format=%I:%M %p<-------------------------This will format the clock, but it fails to update
;IfTrueAction=[!UpdateMeter MeterMinutesHand]

Meter:

[TextStyle]
FontFace=#FontFace#
FontColor=#FontColor#
SolidColor=0,0,0,1
StringStyle=Bold
StringAlign=Right
AntiAlias=1

[MeterTime]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureTime
X=235
Y=80
FontSize=15
;Format=%I:%M %p<-------------------Formatting here has no affect
As I specified in my answer to your question on Deviantart use the following measure to display the time in 12H format:

Code: Select all

[MeasureTime]
Measure=Time
Format=%I:%M %p
So replace [MeasureTime] in your code (which is used by the analog clock) with the measure above.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time format issue after converting analog clock to digital

Post by balala »

paul1965 wrote: March 7th, 2024, 6:11 pm Here's the code I have in the .ini file:
xenium is definitely the best able to say you what to do, he being the author. and he even did, so I add just something you have to know about: the Format option which you've commented out in your code does what you want. It add the needed format to the clock. But if you had the comment (this part on the Format option: <-------------------------This will format the clock, but it fails to update). you get this string added to the format, getting the time like (for instance): 09:03 PM<-------------------------This will format the clock, but it fails to update. Since the [MeterTime] meter is right aligned, the time is not visible, because it is not enough placed on right. This means that since the string is right aligned, you see its right part, but the properly formatted time goes outside of the skin, to left. Nothing on a skin placed to left of the left edge of skin can be done visible. This is why you don't see the time and the string seems not updated. In fact it is, but you simply can't see it.
Simplest solution is to remove the <-------------------------This will format the clock, but it fails to update part of the Format option, as in fact xenium suggested.
paul1965
Posts: 11
Joined: March 7th, 2024, 4:44 pm

Re: Time format issue after converting analog clock to digital

Post by paul1965 »

xenium wrote: March 7th, 2024, 6:43 pm As I specified in my answer to your question on Deviantart use the following measure to display the time in 12H format:

Code: Select all

[MeasureTime]
Measure=Time
Format=%I:%M %p
So replace [MeasureTime] in your code (which is used by the analog clock) with the measure above.
Thanks, but I'm obviously doing something wrong. With this code, the clock is formatted to my liking, but it fails to update every minute:

Code: Select all

[MeasureTime]
Measure=Time
;IfCondition=(MeasureTime % 60) = 0
;IfTrueAction=[!UpdateMeter MeterTime]
Format=%I:%M %p]
With this code, the clock updates every minute but is formatted HH:MM:SS

Code: Select all

[MeasureTime]
Measure=Time
IfCondition=(MeasureTime % 60) = 0
IfTrueAction=[!UpdateMeter MeterTime]
;Format=%I:%M %p
Is there a default format somewhere else that's causing this?
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time format issue after converting analog clock to digital

Post by balala »

paul1965 wrote: March 7th, 2024, 7:23 pm Is there a default format somewhere else that's causing this?
There is a default Format option for the Time measure (and that indeed is %H:%M:%S, as you can see here), which applies when you set no Format option, but either way the measure should update. I can't imagine a case in which the skin (the measure and the meter) updates normally with one Format of the Time measure, but doesn't with the other.
Try the followings:
  • Make sure the Update option of the [Rainmeter] section is set to the default Update=1000.
  • Make sure you have no UpdateDivider=-1 option set neither on the [MeasureTime] measure, nor on the [MeterTime] meter either (and not on the [TextStyle] style section either).
  • Replace the Format option of the [MeasureTime] measure by this: Format=%I:%M:%S %p. This adds the seconds to the time. Obviously you'll remove the :%S part of the Format option later, but adding this makes to can easier check how the measure is updated (if the measure returns the seconds, you see immediately if it is updated).
Are you sure the time is not updated? If you're sure, post please the whole code of your skin, not just parts of it, to can check what's going on.
paul1965
Posts: 11
Joined: March 7th, 2024, 4:44 pm

Re: Time format issue after converting analog clock to digital

Post by paul1965 »

balala wrote: March 7th, 2024, 7:40 pm
[*]Make sure you have no UpdateDivider=-1 option set neither on the [MeasureTime] measure, nor on the [MeterTime] meter either (and not on the [TextStyle] style section either).
That was it! I had incorrectly commented out the old analog code, so the UpdateDivider=-1 was still active on MeterMinutesHand. Once I commented that out, the digital clock started updating as expected. THANKS!
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time format issue after converting analog clock to digital

Post by balala »

paul1965 wrote: March 7th, 2024, 7:54 pm That was it! I had incorrectly commented out the old analog code, so the UpdateDivider=-1 was still active on MeterMinutesHand. Once I commented that out, the digital clock started updating as expected.
You're welcome. Glad you got it working finally.