It is currently July 13th, 2024, 4:00 pm

Default value of the TimeZone option

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16389
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Default value of the TimeZone option

Post by balala »

Hi everybody,

Now it's my turn again to ask something. I have the following extremely simple Time measure:

Code: Select all

[MeasureTime]
Measure=Time
Format=%H:%M
If I add a TimeZone=0 option, I get the current UTC time. This does work.
If I add any valid numeric value to the TimeZone option (eg TimeZone=2 or TimeZone=-5) I get the appropriate time. With TimeZone=local I get the local time. All this are workign as well.
But if I add any (let's say) invalid string (for instance TimeZone=locale or TimeZone=Whatever), I get the time as for TimeZone=0, not my current local time. This seems a little bit intricating, because as far as I know if an invalid value has been used, the measure should use the default value, which in this case should be TimeZone=local.
Where is the mistake?

Thanks in advance.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Default value of the TimeZone option

Post by brax64 »

balala wrote: September 4th, 2020, 5:44 pm Hi everybody,

Now it's my turn again to ask something. I have the following extremely simple Time measure:

Code: Select all

[MeasureTime]
Measure=Time
Format=%H:%M
If I add a TimeZone=0 option, I get the current UTC time. This does work.
If I add any valid numeric value to the TimeZone option (eg TimeZone=2 or TimeZone=-5) I get the appropriate time. With TimeZone=local I get the local time. All this are workign as well.
But if I add any (let's say) invalid string (for instance TimeZone=locale or TimeZone=Whatever), I get the time as for TimeZone=0, not my current local time. This seems a little bit intricating, because as far as I know if an invalid value has been used, the measure should use the default value, which in this case should be TimeZone=local.
Where is the mistake?

Thanks in advance.
Hi Balala,
I don't know the answer to your question, sorry... but to get the UTC time, I've to use TimeZone=-1, is that depending by the DST?
User avatar
balala
Rainmeter Sage
Posts: 16389
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Default value of the TimeZone option

Post by balala »

brax64 wrote: September 4th, 2020, 6:58 pm Hi Balala,
I don't know the answer to your question, sorry... but to get the UTC time, I've to use TimeZone=-1, is that depending by the DST?
Yep, I suppose it does. However my question is related to what value is used for TimeZone if a non-valid string is set on.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Default value of the TimeZone option

Post by Mor3bane »

balala wrote: September 4th, 2020, 7:03 pm Yep, I suppose it does. However my question is related to what value is used for TimeZone if a non-valid string is set on.
Sorry if I am missing the point, but why would an invalid data string be required to work?

If its wrong then it should simply throw an error in the log, ya?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
CyberTheWorm
Posts: 859
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Default value of the TimeZone option

Post by CyberTheWorm »

Code: Select all

[MeasureTimeZone]
Measure=Time
Format=UTC
I just use UTC
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
Alex88
Posts: 92
Joined: July 18th, 2020, 1:23 am
Location: California

Re: Default value of the TimeZone option

Post by Alex88 »

From what I've tried, once TimeZone= is present within the measure, having it blank or with or without a valid value, it seems to default to 0. Then when TimeZone= is not present, it defaults to the stated local time. I'm just guessing at the details of how it works, but that could mean if the TimeZone= option is present, it converts to looking for numerical values only aside from local, so 0 is the new default?
User avatar
jsmorley
Developer
Posts: 22646
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Default value of the TimeZone option

Post by jsmorley »

CyberTheWorm wrote: September 4th, 2020, 11:44 pm

Code: Select all

[MeasureTimeZone]
Measure=Time
Format=UTC
I just use UTC
That is an error, which defaults to 0. It's a happy error, in that the result is what you want, but I don't particularly recommend it.
User avatar
CyberTheWorm
Posts: 859
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Default value of the TimeZone option

Post by CyberTheWorm »

jsmorley wrote: September 5th, 2020, 2:53 am That is an error, which defaults to 0. It's a happy error, in that the result is what you want, but I don't particularly recommend it.
OK dumb me, well at least UTC is TZ 0
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
balala
Rainmeter Sage
Posts: 16389
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Default value of the TimeZone option

Post by balala »

jsmorley wrote: September 5th, 2020, 2:53 am That is an error, which defaults to 0. It's a happy error, in that the result is what you want, but I don't particularly recommend it.
Alright, but the question is if a not-valid string is used why we don't get the result as for TimeZone=local (the default value), but as for TimeZone=0.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Default value of the TimeZone option

Post by Mor3bane »

I may have the logic wrong, but the local parameter is indeed the local time the computer uses, whilst 0 is the equivalent to the UTC timezone, as is whatever locations are at -4, and +9. Being numeric as the 0 to + or - 12 range are.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.