utc_offset, timezone, dst, datetime and abbreviation
I realize this should be simple but I am really stumbling as there is a "utc_datetime" entry which I do not want. Now my head is wrapped around the axle and I am capturing the entire string.
Help appreciated!
Last edited by ms310 on September 21st, 2019, 4:11 am, edited 1 time in total.
Interesting example, however I can't get it to work for me. I mean that if I replace the Asia and Tokyo with anything related to Europe, there is no json file to download.
Is there a site to look for the appropriate URL for other locations around the world?
balala wrote: ↑September 21st, 2019, 6:32 pm
Interesting example, however I can't get it to work for me. I mean that if I replace the Asia and Tokyo with anything related to Europe, there is no json file to download.
Is there a site to look for the appropriate URL for other locations around the world?
Have a look at this information page: http://worldtimeapi.org/
It details how the API should work. I haven't tried to use in any skins, but it looks like it may replace the Yandex time site I currently use...
eclectic-tech wrote: ↑September 21st, 2019, 9:07 pm
Have a look at this information page: http://worldtimeapi.org/
It details how the API should work. I haven't tried to use in any skins, but it looks like it may replace the Yandex time site I currently use...
This is what I was thinking too!
The disadvantage I see vs. Yandex is you can only get one result at a time. Your solution for Yandex is quite cool - you fetch all zones with one call. With the Worldtimeapi.org feed I am thinking I need to make 6 separate calls:
I've used a method Eclectic-Tech used in an older TimeZone skin - I am calling WebParser.dll 6 times by starting with them all disabled and only enabling each one when the prior call finishes.
The result is a little slow and sometimes the first call finishes last - but - so far I think it is working. Since the Worldtimeapi returns the utc_offset directly and the DST true/false the date functions in Rainmeter seems to handle the rest.
Thanks as always for the help!
The current result is shown below. I may add some formatting and coloring but so far I am OK with the progress.
2019-09-22_20h25_01.png
You do not have the required permissions to view the files attached to this post.
@ms310 Yes, I have done the access both in 1 call and as separate calls.
F.Y.I.
I did this because Yandex returns the values according to their numbering system when using 1 call. This made it difficult to easily arrange the information in an alternate order.
My solution was to create separate variables for each returned city/time, and assign them to the desired measures which let's you display the cities in any desired order.
[Variables]
; ------------------------------------------------------------------------
; SORT CITIES DISPLAY ORDER
; ------------------------------------------------------------------------
; To sort times manually change the value after the equal sign ending number (1~8) based city name tooltip info in the skin (hover over city name to see the # for that city)
City1=measureName4
Time1=measureTime4
City2=measureName2
Time2=measureTime2
City3=measureName5
Time3=measureTime5
City4=measureName6
Time4=measureTime6
City5=measureName3
Time5=measureTime3
City6=measureName1
Time6=measureTime1
City7=measureName7
Time7=measureTime7
City8=measureName8
Time8=measureTime8
eclectic-tech wrote: ↑September 22nd, 2019, 3:25 pm
@ms310 Yes, I have done the access both in 1 call and as separate calls.
F.Y.I.
I did this because Yandex returns the values according to their numbering system when using 1 call. This made it difficult to easily arrange the information in an alternate order.
My solution was to create separate variables for each returned city/time, and assign them to the desired measures which let's you display the cities in any desired order.
[Variables]
; ------------------------------------------------------------------------
; SORT CITIES DISPLAY ORDER
; ------------------------------------------------------------------------
; To sort times manually change the value after the equal sign ending number (1~8) based city name tooltip info in the skin (hover over city name to see the # for that city)
City1=measureName4
Time1=measureTime4
City2=measureName2
Time2=measureTime2
City3=measureName5
Time3=measureTime5
City4=measureName6
Time4=measureTime6
City5=measureName3
Time5=measureTime3
City6=measureName1
Time6=measureTime1
City7=measureName7
Time7=measureTime7
City8=measureName8
Time8=measureTime8
; ------------------------------------------------------------------------
; World Time Meters
; ------------------------------------------------------------------------
[meterZoneName1]
Meter=String
MeterStyle=StyleSmallText
MeasureName=#City1#
X=#LeftPadding#
Y=([Date:Y]+30)
W=(#BackgroundWidth#*0.5)
Group=Times
UpdateDivider=-1
Tooltiptext=#City1#
[meterTime1]
Meter=String
MeterStyle=StyleSmallText | StyleRightAlign
MeasureName=#Time1#
X=(#BackgroundWidth#-#LeftPadding#)
Y=r
W=(#BackgroundWidth#*0.5)
Text=%1
; %1 stands for the value of MeasureName (measureTime in this case).
Group=Times
[meterZoneName2]
Meter=String
MeterStyle=StyleSmallText
MeasureName=#City2#
;MeasureName2=measureTime2Zone
X=#LeftPadding#
Y=4R
W=(#BackgroundWidth#*0.5)
Group=Times
UpdateDivider=-1
Tooltiptext=#City2#
[meterTime2]
Meter=String
MeterStyle=StyleSmallText | StyleRightAlign
MeasureName=#Time2#
X=(#BackgroundWidth#-#LeftPadding#)
Y=r
W=(#BackgroundWidth#*0.5)
Text=%1
; %1 stands for the value of MeasureName (measureTime in this case).
Group=Times
...
As usual there are many ways to achieve the desired result. I doubt if multiple calls can be combined using this API.
Yeah - I couldn’t figure out a way to get the worldtimeapi site to return multiple values - I am thankful you created the multiple calls method that I could hack apart. Thank you!