Question: About TimeZone on time measure

Help with creating, editing & fixing problems with skins
User avatar

Question: About TimeZone on time measure

February 10th, 2017, 3:21 am
LittleOne
   [29 posts]

i have this code on the skin

Code: Select all

[MsTime]
Measure=Time
Format=%Y-%m-%dT%H:%M:%SZ
TimeZone=
DynamicVariables=1
OnUpdateAction=[!SetVariable MinTime [MsTime]]

[MsCurrentDate]
Measure=Time
Format=%Y/%m/%d
DynamicVariables=1
OnUpdateAction=[!SetVariable CurrentDate [MsCurrentDate]]

but on midnight i found this
the different is only Timezoneis not on MsCurrentDate
as i know if the timezone is not specified is supposed to be set to my local time, so the question is on what timezone MsTime is?, or i misunderstand it?

note: my current timezone is UTC+07:00
also windows date format is MM DD YYYY while measure format is DD MM YYYY
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 9:30 am
balala
Rainmeter Sage   [4520 posts]

LittleOne wrote:but on midnight i found this
Bug2.jpgthe different is only Timezoneis not on MsCurrentDate
as i know if the timezone is not specified is supposed to be set to my local time, so the question is on what timezone MsTime is?, or i misunderstand it?

note: my current timezone is UTC+07:00
also windows date format is MM DD YYYY while measure format is DD MM YYYY

You'd have right, if the TimeZone wouldn't be specified on the [MsTime] measure, but it is. You have there an uncompleted (empty) TimeZone option. This is why you have that difference, because it seems that if you leave it uncompleted, Rainmeter understands that the Time Zone is set to 0, while should have to have it set to TimeZone=7. The [MsCurrentDate] measure don't has a such option (neither completed, neither uncompleted) so on this measure the TimeZone is set to the default value and you don't get that difference.
Try to completely remove the TimeZone option (or at least comment it out with a semicolon) from the [MsTime] measure.
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 12:23 pm
LittleOne
   [29 posts]

so it the same as Timezone=0 i thought if i leave it empty it will be Timezone=+7
but there is one thing that i still not understand
those code are used to parse data from some public calendar GCal API
if i remove the timezone option i will lose 7 hours of event
why this is happened?
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 12:44 pm
balala
Rainmeter Sage   [4520 posts]

LittleOne wrote:those code are used to parse data from some public calendar GCal API
if i remove the timezone option i will lose 7 hours of eventTime difference.jpgwhy this is happened?

Not knowing your code, I don't know. Maybe you could add another similar Time measure, one with and the other without the TimeZone option, then use each of them on the proper places.
Or maybe post the whole code, to can see what's happening.
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 2:50 pm
LittleOne
   [29 posts]

the whole code will be overwhelming
so i will gave the code where up to where the parent webparser used

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
   @Include=#ROOTCONFIGPATH#\@Resources\Setting.inc
   @Include2=#CURRENTPATH#\ParsedValue.inc
      ContextTitle=Direct Update
      ContextAction=!Refresh
[Metadata]
Name=PSO2 Schedules
Author=Ant.G
Version=3.0.0
Information=To show what is the next or on going Event on PSO2
License=Respect the Author :) or no more code >:)
[Variables]
GET=(?(?=.*summary).*summary": "(.*)".*"date.*": "(.*)(?(?=T)T(.*))")
SORT=(?(?=.*[MsDateS1]).*[MsDateS1](.*)<end>)
SORT2=(?(?=.*[Date2]).*[Date2](.*)<end>)
SORT3=(?(?=.*[Date3]).*[Date3](.*)<end>)
SKIP=(?(?=.*[MsDateS1]).*[MsDateS1].*<end>)
SKIP2=(?(?=.*[Date2]).*[Date2].*<end>)
ZONE=Asia/Jakarta
KEY=AIzaSyDXBD1BU__jm7eUAOHRDUDr2GGdxsTKtr8
SubList=":00−12:00":"",":00−11:00":"",":00−10:00":"",":00−09:30":"",":00−09:00":"",":00−08:00":"",":00−07:00":"",":00−06:00":"",":00−05:00":"",":00−04:00":"",":00−03:30":"",":00−03:00":"",":00−02:00":"",":00−01:00":"",":00±00:00":"",":00+01:00":"",":00+02:00":"",":00+03:00":"",":00+03:30":"",":00+04:00":"",":00+04:30":"",":00+05:00":"",":00+05:30":"",":00+05:45":"",":00+06:00":"",":00+06:30":"",":00+07:00":"",":00+08:00":"",":00+08:30":"",":00+08:45":"",":00+09:00":"",":00+09:30":"",":00+10:00":"",":00+10:30":"",":00+11:00":"",":00+12:00":"",":00+12:45":"",":00+13:00":"",":00+14:00":""
SortSubList="<item>":"","<time>":"➧ ","<end>":"#CRLF#","<ev>":"-","➧ ":"#CRLF#➧ ",": ":":#CRLF#             ↳","(1 Hour)":"#CRLF#               ----------1 Hours----------","(1 Hours)":"#CRLF#               ----------1 Hours----------","(2 Hour)":"#CRLF#               ----------2 Hours----------","(2 Hours)":"#CRLF#               ----------2 Hours----------","(3 Hour)":"#CRLF#               ----------3 Hours----------","(3 Hours)":"#CRLF#               ----------3 Hours----------","(4 Hour)":"#CRLF#               ----------4 Hours----------","(4 Hours)":"#CRLF#               ----------4 Hours----------","(5 Hour)":"#CRLF#               ----------5 Hours----------","(5 Hours)":"#CRLF#               ----------5 Hours----------","(6 Hour)":"#CRLF#               ----------6 Hours----------","(6 Hours)":"#CRLF#               ----------6 Hours----------","(7 Hour)":"#CRLF#               ----------7 Hours----------","(7 Hours)":"#CRLF#               ----------7 Hours----------","(8 Hour)":"#CRLF#               ----------8 Hours----------","(8 Hours)":"#CRLF#               ----------8 Hours----------","(9 Hour)":"#CRLF#               ----------9 Hours----------","(9 Hours)":"#CRLF#               ----------9 Hours----------","(1h)":"#CRLF#               ----------1 Hours----------","(2h)":"#CRLF#               ----------2 Hours----------","(3h)":"#CRLF#               ----------3 Hours----------","(4h)":"#CRLF#               ----------4 Hours----------","(5h)":"#CRLF#               ----------5 Hours----------","(6h)":"#CRLF#               ----------6 Hours----------","(7h)":"#CRLF#               ----------7 Hours----------","(8h)":"#CRLF#               ----------8 Hours----------","(9h)":"#CRLF#               ----------9 Hours----------"
WeekDaySubsList="Sun":"( 日 ) Sun","Mon":"( 月 ) Mon","Tue":"( 火 ) Tue","Wed":"( 水 ) Wed","Thu":"( 木 ) Thu","Fri":"( 金 ) Fri","Sat":"( 土 ) Sat","-":"/"
MinTime=
CalendarID=v5stvi0k8102q1aiiti7ioctig@group.calendar.google.com
Separator=---------------------------------------
FileURL=File://#CURRENTPATH#WebParserDump.txt
PrefList=https://docs.rainmeter.net/manual/
[MsCurrentDate]
Measure=Time
Format=%Y/%m/%d
DynamicVariables=1
OnUpdateAction=[!SetVariable CurrentDate [MsCurrentDate]]
[MsTime]
Measure=Time
Format=%Y-%m-%dT%H:%M:%SZ
Timezone=0
DynamicVariables=1
OnUpdateAction=[!SetVariable MinTime [MsTime]]
;;=============================================================================================================================================================
[MeasureConnectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
UpdateDivider=1
   IfCondition=MeasureConnectivity = 1
   IfTrueAction=[!EnableMeasure "MsSite"][!SetOption MtImage Greyscale "0"][!SetOption MtImage ToolTipTitle "Connected to Server ☯"][!SetOption MtImage ToolTipText "Timezone is (#ZONE#) #CRLF#Change the timezone on ZONE variables"]
   IfFalseAction=[!SetOption MtImage Greyscale "1"][!SetOption MtImage ToolTipTitle "Offline Mode ☯"][!SetOption MtImage ToolTipText "Can not contact the Rappy Super Server"]
;;=============================================================================================================================================================
;Parsing API info feed
;;=============================================================================================================================================================
[MsSite]
Measure=Plugin
Plugin=WebParser
URL=https://www.googleapis.com/calendar/v3/calendars/#CalendarID#/events?orderBy=startTime&singleEvents=true&timeMin=#MinTime#&timeZone=#ZONE#&fields=items(end,start,summary)&key=#KEY#
RegExp=(?siU)#GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET##GET#
DynamicVariables=1
UpdateRate=600
LogSubstringErrors=0
Disabled=1
Substitute="":"NoEvent"
FinishAction=[!WriteKeyValue EventList List "<item>[MsDateS1]<time>[MsTimeS1]<ev>[MsEvent1]<end><item>[MsDateS2]<time>[MsTimeS2]<ev>[MsEvent2]<end><item>[MsDateS3]<time>[MsTimeS3]<ev>[MsEvent3]<end><item>[MsDateS4]<time>[MsTimeS4]<ev>[MsEvent4]<end><item>[MsDateS5]<time>[MsTimeS5]<ev>[MsEvent5]<end><item>[MsDateS6]<time>[MsTimeS6]<ev>[MsEvent6]<end><item>[MsDateS7]<time>[MsTimeS7]<ev>[MsEvent7]<end><item>[MsDateS8]<time>[MsTimeS8]<ev>[MsEvent8]<end><item>[MsDateS9]<time>[MsTimeS9]<ev>[MsEvent9]<end><item>[MsDateS10]<time>[MsTimeS10]<ev>[MsEvent10]<end><item>[MsDateS11]<time>[MsTimeS11]<ev>[MsEvent11]<end><item>[MsDateS12]<time>[MsTimeS12]<ev>[MsEvent12]<end><item>[MsDateS13]<time>[MsTimeS13]<ev>[MsEvent13]<end><item>[MsDateS14]<time>[MsTimeS14]<ev>[MsEvent14]<end><item>[MsDateS15]<time>[MsTimeS15]<ev>[MsEvent15]<end><item>[MsDateS16]<time>[MsTimeS16]<ev>[MsEvent16]<end><item>[MsDateS17]<time>[MsTimeS17]<ev>[MsEvent17]<end><item>[MsDateS18]<time>[MsTimeS18]<ev>[MsEvent18]<end><item>[MsDateS19]<time>[MsTimeS19]<ev>[MsEvent19]<end><item>[MsDateS20]<time>[MsTimeS20]<ev>[MsEvent20]<end><item>[MsDateS21]<time>[MsTimeS21]<ev>[MsEvent21]<end><item>[MsDateS22]<time>[MsTimeS22]<ev>[MsEvent22]<end><item>[MsDateS23]<time>[MsTimeS23]<ev>[MsEvent23]<end><item>[MsDateS24]<time>[MsTimeS24]<ev>[MsEvent24]<end><item>[MsDateS25]<time>[MsTimeS25]<ev>[MsEvent25]<end><item>[MsDateS26]<time>[MsTimeS26]<ev>[MsEvent26]<end><item>[MsDateS27]<time>[MsTimeS27]<ev>[MsEvent27]<end><item>[MsDateS28]<time>[MsTimeS28]<ev>[MsEvent28]<end><item>[MsDateS29]<time>[MsTimeS29]<ev>[MsEvent29]<end><item>[MsDateS30]<time>[MsTimeS30]<ev>[MsEvent30]<end><last>" "#CURRENTPATH#\ParsedValue.inc"][!SetOption MsGet2ndDate RegExp "(?siU)#SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP##SKIP#<item>(.*)<time>"][!EnableMeasure "MsGet2ndDate"][!UpdateMeasure "MsGet2ndDate"][!SetOption MsParsedValueDay1 RegExp "(?siU)#SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT##SORT#"][!EnableMeasure "MsParsedValueDay1"][!UpdateMeasure "MsParsedValueDay1"]
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 3:59 pm
balala
Rainmeter Sage   [4520 posts]

Try to replace the TimeZone=0 option of the [MsTime] measure with the (in your case) normal Timezone=7. Does this help?
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 4:17 pm
LittleOne
   [29 posts]

Timezone=7 is making MsTime value sync with my PC time, but it making error on the parsed data for 7 hour
Timezone=0 making MsTime value error for 7 hour with my PC time but it sync with the parsed data

:circle: :headbang:
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 4:23 pm
balala
Rainmeter Sage   [4520 posts]

LittleOne wrote:Timezone=7 is making MsTime value sync with my PC time, but it making error on the parsed data for 7 hour

What kind of error?
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 4:26 pm
LittleOne
   [29 posts]

i lost the event from the current time till the next 7 hour
User avatar

Re: Question: About TimeZone on time measure

February 10th, 2017, 4:45 pm
balala
Rainmeter Sage   [4520 posts]

LittleOne wrote:Timezone=0 making MsTime value error for 7 hour with my PC time but it sync with the parsed data

LittleOne wrote:i lost the event from the current time till the next 7 hour

Ok, but if the parsed data are ok, then do you also need somewhere else the value of the [MsTime] measure? Because if you do, you could create another Time measure with a properly set TimeZone and use that anywhere else, except the WebParser measure.
Anyway, in my opinion the solution would be to use two Time measures (one with TimeZone=0 and the other with TimeZone=7) and use each of them where it is needed.

Return to “Help: Rainmeter Skins”



Who is online

Users browsing this forum: VRArt1 and 3 guests