Page 1 of 1
Template Timestamp converter feature request **solved**
Posted: Tue Dec 04, 2018 10:14 am
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,
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 12:21 pm
by Mattk
What do you term as epoch-time?
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 2:29 pm
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
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 8:55 pm
by Mattk
What's wrong with the MB Time /Date variable epoch? Defines Unix time in seconds since Jan 1, 1970
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 9:30 pm
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?
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 11:16 pm
by admin
I get your point. I will have a look if a "=epoch" converter is tricky to realize. No promises so far.
Re: Template Timestamp converter feature request
Posted: Tue Dec 04, 2018 11:45 pm
by admin
I added that to the just released update. Please give it a try.
Re: Template Timestamp converter feature request
Posted: Wed Dec 05, 2018 12:04 am
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,
Re: Template Timestamp converter feature request
Posted: Wed Dec 05, 2018 12:11 am
by admin
When you reboot your Meteobridge you have it installed. It is already live.

Re: Template Timestamp converter feature request
Posted: Wed Dec 05, 2018 12:14 am
by bardek
I can confirm its working
I'm grateful for best support.
Re: Template Timestamp converter feature request **solved**
Posted: Sun Mar 22, 2020 6:30 pm
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.
Re: Template Timestamp converter feature request **solved**
Posted: Sat Mar 28, 2020 1:09 am
by admin
This does not add any noticeable workload.