Template Timestamp converter feature request **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
bardek
Senior Boarder
Senior Boarder
Posts: 41
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Template Timestamp converter feature request **solved**

Post by bardek »

From templates...
When variable returns a timestamp, then this converter can be applied:

utc reports timestamp in UTC instead of localtime, which is default.
apm reports timestamp as local time in AM/PM style. Example "201603011123344AM" indicates "2016 March 11, 12:33:44 AM".
It could be nice to get "timestamp" as epoch-time for further processing (i.e. external db inserts, jpa etc)

Regards,

Mattk
Platinum Boarder
Platinum Boarder
Posts: 778
Joined: Mon Sep 22, 2014 3:24 am

Re: Template Timestamp converter feature request

Post by Mattk »

What do you term as epoch-time?

bardek
Senior Boarder
Senior Boarder
Posts: 41
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Re: Template Timestamp converter feature request

Post by bardek »

Unix time (also known as POSIX time or UNIX Epoch time)
now to write to my external mysql db I have to convert it from meteobridge timestamp "201603011123344" to unix epoch time

Mattk
Platinum Boarder
Platinum Boarder
Posts: 778
Joined: Mon Sep 22, 2014 3:24 am

Re: Template Timestamp converter feature request

Post by Mattk »

What's wrong with the MB Time /Date variable epoch? Defines Unix time in seconds since Jan 1, 1970

bardek
Senior Boarder
Senior Boarder
Posts: 41
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Re: Template Timestamp converter feature request

Post by bardek »

epoch is OK, but it is not converter or its is?
[epoch] as template documentation states, gives us epoch timestamp of current time.

How to get unix epoch time of i.ie [th0temp-maxtime]? all I can get is "201603011123344" it does not look like epoch ts does it?
[th0temp-maxtime=epoch] would do this that is why I kindly ask for such.
By the way you save it as unix epoch ts in sqlite DB don't you? so probably there is some conversion ongoing.

Mattk, your questions are confusing me are you anyway related with meteobrige product or its me, that I cannot express the problem?

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6064
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin »

I get your point. I will have a look if a "=epoch" converter is tricky to realize. No promises so far.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6064
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin »

I added that to the just released update. Please give it a try.

bardek
Senior Boarder
Senior Boarder
Posts: 41
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Re: Template Timestamp converter feature request

Post by bardek »

great, thank you. I'll try it as soon its released. For me this functionality will ease many things.
Thank you again for quick response.

Regards,

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6064
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin »

When you reboot your Meteobridge you have it installed. It is already live. ;-)

bardek
Senior Boarder
Senior Boarder
Posts: 41
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Re: Template Timestamp converter feature request

Post by bardek »

I can confirm its working :)

I'm grateful for best support.

WS Heinenoord
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sun Dec 22, 2019 2:08 pm

Re: Template Timestamp converter feature request **solved**

Post by WS Heinenoord »

I'm wondering, would the conversion to Unix Epoch time take extra processor time compared to using [th0temp-dmaxtime.ij:--]:[th0temp-dmaxtime.kl:--] for a time expression?
I like to keep the Meteobridge workload as low as possible, and can have the website server work on getting a "hour:minutes" printed when the page is called.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6064
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request **solved**

Post by admin »

This does not add any noticeable workload.

Post Reply