It is currently March 29th, 2024, 3:28 pm

Unix Time conversion plugin

Share and get help with Plugins and Addons
Falxon
Posts: 12
Joined: May 5th, 2020, 3:04 pm

Unix Time conversion plugin

Post by Falxon »

Announcing the Launch of the UnixTimeConverter plugin!

Hey folks!

I wanted to share a plugin I just wrote that you may find useful. As many of you have been doing, I have been forced to change most of my weather applets to use OpenWeatherMap data sources. Since they use a UNIX epoch time for their date/time values, it has been a pain to make easy updates to skins without resorting to Lua scripting, etc.

So I decided to try my hand at my first plugin. It is available at https://github.com/DoubleStrike/Rainmeter-UnixTimeConverter.

It is admittedly in its early stages, so feel free to post issues or send feedback via the repository. This is my first foray into creating plugins, so I am continuing to improve it via more error handling and adding debug options, etc. I hope you find it useful!
You do not have the required permissions to view the files attached to this post.
Last edited by Falxon on May 5th, 2020, 7:32 pm, edited 1 time in total.
Falxon
Posts: 12
Joined: May 5th, 2020, 3:04 pm

Re: Unix Time conversion plugin

Post by Falxon »

Just a quick note to let you guys know that version 1.1 is released with error handling and some basic logging.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Unix Time conversion plugin

Post by mak_kawa »

Hi Falxon

Interesting plugin. Thank you for providing.
I have not noticed that the OpenWeatherMap API returns UNIX time as update date in the case of JSON format, because I am using XML format.

And...Once I used DarkSky API that always returns UNIX time as update/forecast time. So, I wrote measures for conversion as follows;

Code: Select all

[MeasureTime]
Measure=WebParser
URL=[MeasureValues]
StringIndex=1

[MeasureUnixTimeStart]
Measure=Time
TimeStamp=1970/01/01 00:00:00
TimeStampFormat=%Y/%m/%d %H:%M:%S
UpdateDivider=-1

[MeasureUnixTimeToWindowsTime]
Measure=Calc
Formula=[MeasureTime]+[MeasureUnixTimeStart:]
DynamicVariables=1

[MeasureTimeConvert]
Measure=Time
TimeStamp=[MeasureUnixTimeToWindowsTime]
Format=%Y/%m/%d(%a) %H:%M:%S
DynamicVariables=1
At a glance, I am not sure what is the advantage of your plugin compared with above method using Time and Calc measures. I would appreciate if you could let me know.
Falxon
Posts: 12
Joined: May 5th, 2020, 3:04 pm

Re: Unix Time conversion plugin

Post by Falxon »

mak_kawa wrote: May 5th, 2020, 9:47 pm Hi Falxon

Interesting plugin. Thank you for providing.
I have not noticed that the OpenWeatherMap API returns UNIX time as update date in the case of JSON format, because I am using XML format.

At a glance, I am not sure what is the advantage of your plugin compared with above method using Time and Calc measures. I would appreciate if you could let me know.
Thanks for the response. So the thought process was to provide a very simple "plug-and-play" solution for people not comfortable with scripting in plugins. While your code is admittedly quite clear and straightforward, I've seen lots of posts from people who still struggle with even Parent/Child measures. Also, if you want 5-10 different times converted, you'd have to use one block of measures/conversions per instance, as you currently have them without doing some fancier tricks.

Second, I am planning to add locale and timezone based functions to allow even more functionality without need for scripting/formulas.

So that's really my thought process. Admittedly, for more advanced users, it may not be all that necessary in its current iteration. Hopefully I can get more features added now that I understand the Plugin API better. Most of yesterday was just getting to terms with how it all worked and getting the GitHub repo set up the way I wanted.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Unix Time conversion plugin

Post by mak_kawa »

Hi Falxon

I acknowledged about your intension for the development of this plugin, thank you.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Unix Time conversion plugin

Post by jsmorley »

We are always DELIGHTED to have another person willing to dig into plugins. You can certainly do a lot of cool things with them, they just have a reasonably steep learning curve.