Code: Select all
[Variables]
Realtime=1
Time=2021-11-18 15:50:00
Rate=1
[Rainmeter]
Update=25
DynamicWindowSize=1
AccurateText=1
---Measures---
[Time]
Group=TimeGroup
Measure=Time
TimeStamp=#Time#
TimeStampFormat=%Y-%m-%d %H:%M:%S
Format=%Y-%m-%d %H:%M:%S
TimeZone=0
DaylightSavingTime=0
OnUpdateAction=[!SetOption Time TimeStamp "((#*Realtime*#=1)?(-1):([*Time:Timestamp*]+#*Rate*#*240))"][!SetOption Time TimeStampFormat ""]
DynamicVariables=1
[TimezoneLocal]
Group=TimeGroup
Measure=Time
Format=%z
RegExpSubstitute=1
Substitute="^(.{1})(.{2})(.{2})$":"\1\2.\3"
DynamicVariables=1
[TimeLocal]
Group=TimeGroup
Measure=Time
TimeStamp=([Time:Timestamp][TimezoneLocal]*60*60)
Format=%Y-%m-%d %H:%M:%S
DynamicVariables=1
---Meters---
[Text]
Meter=String
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
MeasureName=Time
MeasureName2=TimeLocal
MeasureName3=TimezoneLocal
Text="Time = %1#CRLF#Time (local) = %2#CRLF#Timezone = %3#CRLF#Realtime = #Realtime##CRLF#Speed Factor = #Rate#"
LeftMouseUpAction=[!TogglePauseMeasureGroup TimeGroup][!UpdateMeter *][!Redraw]
MiddleMouseUpAction=[!SetVariable Realtime (1-#Realtime#)][!UpdateMeasureGroup TimeGroup][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable Rate (Clamp((#Rate#+1),-360,360))][!UpdateMeasureGroup TimeGroup][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Rate (Clamp((#Rate#-1),-360,360))][!UpdateMeasureGroup TimeGroup][!UpdateMeter *][!Redraw]
DynamicVariables=1
The thing is that I want to "attach" to the said UTC Time measure a local Time measure, automatically if possible via [Time:Timestamp] and local timezone detection (NOT hardcoded!). For now, I use a rather rudimentary method of adding the timezone to the UTC time, but I would preferably avoid doing so if there's a simpler method to do it. I'd also want to take the daylight saving into account (still not entirely sure about that though).
My questions are:
- is it possible to do this "automatically" / simple by using some timezone identifier in the local Time measure, instead of adding all kinds of timezone or daylight saving stuff to the main timestamp?
- if the answer above is no, what method would you recommend (e.g. Time vs SysInfo measures) and what / how exactly should I add them to get the local time equivalent of the UTC? I saw somewhere a skin by jsmorley that did something similar, but I can't remember where and whether all the stuff there would really be necessary in my case...