I need help with this ?
[MeasureCasCorr]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRegExp]
StringIndex=1
Substitute="+0100":"3600"
[MeasureFormat1TimestampCorr]
measure=Calc
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr:])
DynamicVariables=1
with this is time increased only about 1 minute not about 1 hour.
It is currently April 27th, 2024, 5:52 am
Time zone offset problem
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Time zone offset problem
Last edited by pds on January 21st, 2016, 6:01 pm, edited 1 time in total.
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Re: Time zone offset problem
MeasureFormat1Timestamp is normal time,if i have formula=([MeasureFormat1Timestamp:Timestamp]+3600) it works ok.jsmorley wrote:What is [MeasureFormat1Timestamp]? If that is not a Time measure, then the :timestamp section variable modifier won't work on it.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Time zone offset problem
You want this:pds wrote:MeasureFormat1Timestamp is normal time,if i have formula=([MeasureFormat1Timestamp:Timestamp]+3600) it works ok.
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr])
WebParser measures just never return any "number" value, and you must use the string value in the Calc measure and let that convert the string number to a number number...
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRegExp]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Test.html
RegExp=(?siU)<offset>(.*)</offset>
[MeasureCasCorr]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRegExp]
StringIndex=1
Substitute="+0100":"3600"
[MeasureFormat1Timestamp]
Measure=Time
Format=%a, %#d %b %Y %H:%M:%S
[MeasureFormat1TimestampCorr]
measure=Calc
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr])
DynamicVariables=1
[MeasureOffsetTime]
Measure=Time
TimeStamp=[MeasureFormat1TimestampCorr]
Format=%a, %#d %b %Y %H:%M:%S
DynamicVariables=1
[MeterTime]
Meter=String
MeasureName=MeasureFormat1Timestamp
MeasureName2=MeasureOffsetTime
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 | %2
You do not have the required permissions to view the files attached to this post.
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Re: Time zone offset problem
That gave me an error Calc:Extra operation. I tryed this before.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Time zone offset problem
The problem is going to be when the skin first is loaded or refreshed, and the value of the WebParser measure is still "". It's not a fatal error, and will only happen once when the skin is refreshed. As soon as the WebParser measure in fact finishes getting the information from the site, the error will go away.pds wrote:That gave me an error Calc:Extra operation. I tryed this before.
Remember that WebParser is "threaded" and doesn't wait for a result to allow the skin to continue processing. We never want a call to the internet, which can take some time (maybe even a LOT of time in some cases) to "block" the skin. So the initial value of all WebParser measures is "" or an empty string. The skin continues to run while WebParser goes off on its own in a separate thread and does its work. As soon as data from the remote resource is received, WebParser will automatically populate all the child measures, and the information in them will then be available.
Most measures in Rainmeter do in fact "block", and wait for an answer before allowing the skin to continue. This is because the time it takes to get the system time in a Time measure (for instance) basically rounds to zero. So they will have a value immediately in the first skin update. Threaded plugins, like WebParser, FileView, and RunCommand can't assume that an answer will instantly be forthcoming. So they tell the skin "you go ahead on, I'll get back to you when I'm done..."
So what you are getting on the first update of the skin is in effect:
formula=([MeasureFormat1Timestamp:Timestamp]+)
And Calc is complaining, "Plus what??"
Likely by the second skin update (although that is not certain) WebParser has populated the child measures, and you get:
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr])
And Calc says "Oh, OK. I gotcha..."
You can fix the error in the log with:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRegExp]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Test.html
RegExp=(?siU)<offset>(.*)</offset>
FinishAction=[!EnableMeasureGroup "Times"]
[MeasureCasCorr]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRegExp]
StringIndex=1
Substitute="+0100":"3600"
[MeasureFormat1Timestamp]
Measure=Time
Format=%a, %#d %b %Y %H:%M:%S
[MeasureFormat1TimestampCorr]
measure=Calc
Group=Times
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr])
DynamicVariables=1
Disabled=1
[MeasureOffsetTime]
Measure=Time
Group=Times
TimeStamp=[MeasureFormat1TimestampCorr]
Format=%a, %#d %b %Y %H:%M:%S
DynamicVariables=1
Disabled=1
[MeterTime]
Meter=String
MeasureName=MeasureFormat1Timestamp
MeasureName2=MeasureOffsetTime
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 | %2
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Re: Time zone offset problem
Thanks. But sometning must be wrong because [MeasureCasCorr] gave me 100 instead 3600 i don't know why.
If i look at Measure value there is 3600. weird
If i look at Measure value there is 3600. weird
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Time zone offset problem
Well, I'm not quite sure. I'd need to see the entire skin code. If you test my example above, it clearly works as you intend, so there has to be some difference. Some reason why it is continuing to see the actual string value of "+0100" (which would be "100" to Calc) instead of the substituted value of "3600".pds wrote:Thanks. But sometning must be wrong because [MeasureCasCorr] gave me 100 instead 3600 i don't know why.
If i look at Measure value there is 3600. weird
Perhaps StringIndex 1 isn't returning just "+0100" but "+0100#CRLF# " or " +0100" or "+0100 " or something, so that while it "looks" like the measure's string value is "3600", it really isn't...
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Time zone offset problem
You might try something like:
Working that [MeterTest] meter into your skin of course. That will display the exact string value being returned by [MeasureCasCorr].
If you get something like:
Then you will need to either fix your RegExp, or change your Substitute to Substitute="+0100":"3600","#CRLF#":"".
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRegExp]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Test.html
RegExp=(?siU)<offset>(.*)</offset>
FinishAction=[!EnableMeasureGroup "Times"]
[MeasureCasCorr]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRegExp]
StringIndex=1
Substitute="+0100":"3600"
[MeterTest]
Meter=String
MeasureName=MeasureCasCorr
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=>>%1<<
[MeasureFormat1Timestamp]
Measure=Time
Format=%a, %#d %b %Y %H:%M:%S
[MeasureFormat1TimestampCorr]
measure=Calc
Group=Times
formula=([MeasureFormat1Timestamp:Timestamp]+[MeasureCasCorr])
DynamicVariables=1
Disabled=1
[MeasureOffsetTime]
Measure=Time
Group=Times
TimeStamp=[MeasureFormat1TimestampCorr]
Format=%a, %#d %b %Y %H:%M:%S
DynamicVariables=1
Disabled=1
[MeterTime]
Meter=String
Y=10R
MeasureName=MeasureFormat1Timestamp
MeasureName2=MeasureOffsetTime
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=%1 | %2
If you get something like:
Then you will need to either fix your RegExp, or change your Substitute to Substitute="+0100":"3600","#CRLF#":"".
You do not have the required permissions to view the files attached to this post.
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Re: Time zone offset problem
Something is wrong. I tryed simple code and still wrong number.
Formula :formula=([MeasureTimeOffset]+[MeasureTimeOffset]) give error (see pic)
Formula :formula=([MeasureTimeOffset:]+[MeasureTimeOffset:]) give 200 not 7200 (see pic)
URL is google calendar basic.ics file, try yours please.
Formula :formula=([MeasureTimeOffset]+[MeasureTimeOffset]) give error (see pic)
Formula :formula=([MeasureTimeOffset:]+[MeasureTimeOffset:]) give 200 not 7200 (see pic)
URL is google calendar basic.ics file, try yours please.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRegExp]
Measure=Plugin
Plugin=WebParser
URL=https://calendar.google.com/calendar/ical/*******/private-*******/basic.ics
RegExp=(?siU).*TZOFFSETFROM:(.*)TZOFFSETTO
FinishAction=[!EnableMeasureGroup "Times"]
[MeasureTimeOffset]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRegExp]
StringIndex=1
Substitute="#CRLF#":"","+0100":"3600","#CRLF#":""
[MeasureCorr]
measure=Calc
Group=Times
formula=([MeasureTimeOffset]+[MeasureTimeOffset])
DynamicVariables=1
Disabled=1
[MeterTest]
Meter=String
MeasureName=MeasureTimeOffset
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=>>%1<<
You do not have the required permissions to view the files attached to this post.
-
- Posts: 826
- Joined: November 20th, 2012, 11:58 pm
Re: Time zone offset problem
I don't like this solution, but it works
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureRegExp]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#basic.ics
RegExp=(?siU).*TZOFFSETFROM:\s*(.*)\s*TZOFFSETTO
StringIndex=1
FinishAction=[!EnableMeasureGroup "Times"]
[MeasureTimeOffset]
Measure=String
String=[MeasureRegExp]
DynamicVariables=1
Substitute="+0900":"3600"
[MeasureCalc]
Measure=Calc
Formula=([MeasureTimeOffset] + [MeasureTimeOffset])
DynamicVariables=1
Group=Times
Disabled=1
[MeterTest]
Meter=String
MeasureName=MeasureTimeOffset
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=>>%1<<