It is currently May 7th, 2024, 11:12 pm

Daylight Saving Time in the US

General topics related to Rainmeter.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Daylight Saving Time in the US

Post by jsmorley »

Don't forget to "spring forward" in the United States before you go to bed tonight!

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=20,30,40,255
SolidColor2=30,40,50,255
AccurateText=1

[Metadata]
Name=TimeZone
Author=JSMorley
Information=Demonstration of the Time Zone / Daylight Saving Time functionality in Rainmeter.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=Mar 13, 2021

; Measures

[MeasureNow]
Measure=Time
Format=%A, %B %#d, %Y at %#I:%M:%S %p

[MeasureYear]
Measure=Time
Format=%Y

[MeasureTimeZoneISDST]
Measure=Plugin
Plugin=SysInfo
SysInfoType=TIMEZONE_ISDST
UpdateDivider=60
IfCondition=MeasureTimeZoneISDST = 1
IfTrueAction=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneDaylightName"][!SetOption MeterDSTNextChange Text "Daylight Saving Time will end#CRLF#[*MeasureDSTNextEnd*]"]
IfCondition2=MeasureTimeZoneISDST = 0
IfTrueAction2=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneStandardName"][!SetOption MeterDSTNextChange Text "Daylight Saving Time will start#CRLF#[*MeasureDSTNextStart*]"]
IfCondition3=MeasureTimeZoneISDST = -1
IfTrueAction3=[!SetOption MeterTimeZone MeasureName "MeasureTimeZoneStandardName"][!HideMeterGroup TimeZone]
OnChangeAction=[!UpdateMeasureGroup TimeZone][!UpdateMeter *][!Redraw]

[MeasureTimeZoneBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_BIAS
UpdateDivider=-1

[MeasureDSTStandardBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_STANDARD_BIAS
UpdateDivider=-1

[MeasureDSTDaylightBias]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_DAYLIGHT_BIAS
UpdateDivider=-1

[MeasureDSTCurrentBias]
Measure=Calc
Group=TimeZone
Formula=MeasureTimeZoneISDST = 1 ? MeasureDSTDaylightBias : MeasureDSTStandardBias 
UpdateDivider=-1

[MeasureCalcBiasHours]
Measure=Calc
Group=TimeZone
Formula=0-(trunc((MeasureTimeZoneBias + MeasureDSTCurrentBias) / 60))
RegExpSubstitute=1
Substitute="^([\d]{1,2})$":"+\1","^([+-]{1})(\d)$":"\10\2"
UpdateDivider=-1

[MeasureCalcBiasMinutes]
Measure=Calc
Group=TimeZone
Formula=Abs(60 * (frac(MeasureTimeZoneBias / 60)))
RegExpSubstitute=1
Substitute="^(\d)$":"\10"
UpdateDivider=-1

[MeasureTimeZoneStandardName]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_STANDARD_NAME
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.*)$":"\1 [UTC [MeasureCalcBiasHours]:[MeasureCalcBiasMinutes]]"
DynamicVariables=1

[MeasureTimeZoneDaylightName]
Measure=Plugin
Plugin=SysInfo
Group=TimeZone
SysInfoType=TIMEZONE_DAYLIGHT_NAME
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.*)$":"\1 [UTC [MeasureCalcBiasHours]:[MeasureCalcBiasMinutes]]"
DynamicVariables=1

[MeasureDSTStartThisYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTStart
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTEndThisYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTEnd
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTStartNextYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTStart([MeasureYear]+1)
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTEndNextYear]
Measure=Time
Group=TimeZone
TimeStamp=DSTEnd([MeasureYear]+1)
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTNextStart]
Measure=Time
Group=TimeZone
TimeStamp=DSTNextStart
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

[MeasureDSTNextEnd]
Measure=Time
Group=TimeZone
TimeStamp=DSTEnd
Format=%A, %B %#d, %Y at %#I:%M:%S %p
UpdateDivider=-1

; Meters

[MeterNow]
Meter=String
MeasureName=MeasureNow
X=0
Y=0
FontSize=12
FontColor=230,240,250,255
Padding=10,10,0,0
AntiAlias=1

[MeterTimeZone]
Meter=String
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1

[MeterDSTNextChange]
Meter=String
Group=TimeZone
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1

[MeterDSTThisYear]
Meter=String
Group=TimeZone
MeasureName=MeasureDSTStartThisYear
MeasureName2=MeasureDSTEndThisYear
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,0
AntiAlias=1
Text=This year's Daylight Saving Time changes:#CRLF#Start	%1#CRLF#End	%2

[MeterDSTNext]
Meter=String
Group=TimeZone
MeasureName=MeasureDSTStartNextYear
MeasureName2=MeasureDSTEndNextYear
X=0
Y=10R
FontSize=11
FontColor=230,240,250,255
Padding=10,0,10,10
AntiAlias=1
Text=Next year's Daylight Saving Time changes:#CRLF#Start	%1#CRLF#End	%2

1.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16202
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Daylight Saving Time in the US

Post by balala »

jsmorley wrote: March 13th, 2021, 1:23 pm Don't forget to "spring forward" in the United States before you go to bed tonight!
Same in EU tonight:
Daylight.png
You do not have the required permissions to view the files attached to this post.