It is currently March 28th, 2024, 8:42 pm

Adding 7 minutes to clock

Get help with installing and using Rainmeter.
svey001
Posts: 3
Joined: March 15th, 2016, 5:45 pm

Adding 7 minutes to clock

Post by svey001 »

How can I use the :

Format=%H:%M and add 7 minutes to it to display on desktop clock.

Tx
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Adding 7 minutes to clock

Post by FreeRaider »

Hello try this code:

Code: Select all

[MeasureTime]
Measure=Time

[MeasurePlus7Minutes]
Measure=Time
TimeStamp=([MeasureTime:TimeStamp] + 7 * 60)
Format=%H:%M 
DynamicVariables=1
svey001
Posts: 3
Joined: March 15th, 2016, 5:45 pm

Re: Adding 7 minutes to clock

Post by svey001 »

Thanks for your suggestion Freeraider,

I have tried to replace the section of clock.ini of illustro/clock with your code but it does not add the 7 minutes to the clock.

Am I doing something incorrectly?


Code: Select all

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

;code suggested by Freeraider
[MeasureTime]
Measure=Time

[MeasurePlus7Minutes]
Measure=Time
TimeStamp=([MeasureTime:TimeStamp] + 7 * 60)
Format=%H:%M 
DynamicVariables=1


;[measureTime]
; This measure returns the time in a 24-hour format (i.e. HH:MM).
;Measure=Time
;Format=%H:%M
; For a 12-hour clock, change the Format option above to: %I:%M %p
; Refer to the Rainmeter manual for other format codes.

;[measureDate]
; Returns the date as DD.MM.YYYY
;Measure=Time
;Format=%d.%m.%Y

[measureDay]
; Returns the current day
Measure=Time
Format=%A
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Adding 7 minutes to clock

Post by FreeRaider »

For example

Code: Select all

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
DynamicWindowSize=1
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Name=Clock
Author=poiru
Information=Displays the current date and time.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------


[measureTime]
; This measure returns the time in a 24-hour format (i.e. HH:MM).
Measure=Time
Format=%H:%M
; For a 12-hour clock, change the Format option above to: %I:%M %p
; Refer to the Rainmeter manual for other format codes.

[MeasurePlus7Minutes]
Measure=Time
TimeStamp=([MeasureTime:TimeStamp] + 7 * 60)
Format=%H:%M 
DynamicVariables=1

[measureDate]
; Returns the date as DD.MM.YYYY
Measure=Time
Format=%d.%m.%Y

[measureDay]
; Returns the current day
Measure=Time
Format=%A

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
; ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
MeasureName=measureTime
MeasureName2=MeasurePlus7Minutes
X=100
Y=12
W=190
H=18
Text=%1#CRLF#%2
; %1 stands for the value of MeasureName (measureTime in this case).

[meterDay]
Meter=String
MeterStyle=styleLeftText
MeasureName=measureDay
X=10
Y=40
W=190
H=14
Text=%1

[meterDate]
Meter=String
MeterStyle=styleRightText
MeasureName=measureDate
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text=%1

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1
svey001
Posts: 3
Joined: March 15th, 2016, 5:45 pm

Re: Adding 7 minutes to clock

Post by svey001 »

Thank you very much.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Adding 7 minutes to clock

Post by FreeRaider »

Glad to help. :welcome:
Cntl-Alt-Delete
Posts: 3
Joined: March 7th, 2019, 9:49 am

Re: Adding 7 minutes to clock

Post by Cntl-Alt-Delete »

Hi all. I'm in the same position as svey001, but I need to add exactly 10 hours to the clock. I tried the solution provided by FreeRaider to see if that worked in adding 7 minutes to the time, but it didn't work for me - both of the clocks (the unaltered one and the time + 7 mins one) are exactly the same. Can anyone give me some help on this?

Thanks.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding 7 minutes to clock

Post by balala »

Cntl-Alt-Delete wrote: March 7th, 2019, 9:58 am I need to add exactly 10 hours to the clock.
You have to add 10 hours (meaning 10 x 60 x 60 sec = 36000) to the TimeStamp of the appropriate Time measure. For example in FreeRaider's above code, modify the TimeStamp option of the [MeasurePlus7Minutes] measure to: TimeStamp=([MeasureTime:TimeStamp]+10*60*60)
If you can't figure out how to do this, please post the code of your skin, for specific help.
Cntl-Alt-Delete
Posts: 3
Joined: March 7th, 2019, 9:49 am

Re: Adding 7 minutes to clock

Post by Cntl-Alt-Delete »

Hi balala:

Thanks for your reply.

Maybe I didn't explain the problem properly. I need to add 10 hours to the Rainmeter clock, and I thought that by modifying Freerider's code I could get what I need. I had already worked out how to do it. (And thanks for your help there!) But I wanted to test Freerider's code first, without any changes, just to see how well it works. I cut/pasted his code to my Clock.ini and reloaded it. Freerider's code is set up to display the normal (unaltered) time in the top line, and the altered (Timestamp + 7 mins) clock below it. But when I reloaded the Clock.ini file, both clocks displayed exactly the same unaltered time...in other words, it was as though the code for the additional 7 mins was being ignored. So there is no point pasting the code here - it is exactly the same as Freerider's code. I can't see why it wouldn't work.

Thanks again
C-A-D
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Adding 7 minutes to clock

Post by balala »

Cntl-Alt-Delete wrote: March 7th, 2019, 11:09 pm I cut/pasted his code to my Clock.ini and reloaded it. Freerider's code is set up to display the normal (unaltered) time in the top line, and the altered (Timestamp + 7 mins) clock below it. But when I reloaded the Clock.ini file, both clocks displayed exactly the same unaltered time...
What Rainmeter version are you using? It's an old one?
Because FreeRaider's code works perfectly with the latest version, as you can see in the attached screenshot:
Clock.png
You do not have the required permissions to view the files attached to this post.