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: 40
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Template Timestamp converter feature request **solved**

Post by bardek » Tue Dec 04, 2018 10:14 am

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: 752
Joined: Mon Sep 22, 2014 3:24 am

Re: Template Timestamp converter feature request

Post by Mattk » Tue Dec 04, 2018 12:21 pm

What do you term as epoch-time?

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

Re: Template Timestamp converter feature request

Post by bardek » Tue Dec 04, 2018 2:29 pm

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: 752
Joined: Mon Sep 22, 2014 3:24 am

Re: Template Timestamp converter feature request

Post by Mattk » Tue Dec 04, 2018 8:55 pm

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: 40
Joined: Fri Jan 16, 2015 7:49 pm
Contact:

Re: Template Timestamp converter feature request

Post by bardek » Tue Dec 04, 2018 9:30 pm

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: 5879
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin » Tue Dec 04, 2018 11:16 pm

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: 5879
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin » Tue Dec 04, 2018 11:45 pm

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

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

Re: Template Timestamp converter feature request

Post by bardek » Wed Dec 05, 2018 12:04 am

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: 5879
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template Timestamp converter feature request

Post by admin » Wed Dec 05, 2018 12:11 am

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

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

Re: Template Timestamp converter feature request

Post by bardek » Wed Dec 05, 2018 12:14 am

I can confirm its working :)

I'm grateful for best support.

Post Reply