Page 1 of 1

Which variables to use for timestamp **solved**

Posted: Sat Feb 19, 2022 7:13 pm
by Eckhardt
Hi everyone,

I have a Meteobridge Pro, it is running for several years, it works brilliantly.
As I am not very much of a programmer, I struggle to use some variables.
Especially this one: I would like to show the day and time of the maximum and minimum temperature of this year in a logical way. I managed to create some other cool variables, but these 2 I really have tried it all, but obviously not in the right way.

If I try this: [th0temp-ymax] it works fine.
When I use the timestamp [th0temp-ymaxtime] I get to see the standard timestamp in a series of numbers.
Excactly how do I have to process the variable to being able to see somehing like: 12 january at 21:34.

I wilud be very thankful for help.

Greetings from the Netherlands

Olaf

Re: Which variables to use for timestamp

Posted: Sat Feb 19, 2022 10:28 pm
by Mattk
https://www.meteobridge.com/wiki/index.php/Templates

Checkout the above link and under the Selectors section you will note that time stamps have the format "YYYYMMDDhhmmss". Is this the series of numbers you are getting?

Also checkout the Time/Date Variables section further down the link as well as the following Decimals section and the means by which sub strings within the Timestamp can be extracted. Also see #6 in the examples section which shows how to extract the time

January (full month names as such) is a more difficult one without a script but Jan, Feb, Mar etc is straight forward using the Time/Date Variable MMM to convert

Re: Which variables to use for timestamp

Posted: Sat Feb 19, 2022 11:19 pm
by Eckhardt
Mattk wrote: Sat Feb 19, 2022 10:28 pm https://www.meteobridge.com/wiki/index.php/Templates

Checkout the above link and under the Selectors section you will note that time stamps have the format "YYYYMMDDhhmmss". Is this the series of numbers you are getting?

Also checkout the Time/Date Variables section further down the link as well as the following Decimals section and the means by which sub strings within the Timestamp can be extracted. Also see #6 in the examples section which shows how to extract the time

January (full month names as such) is a more difficult one without a script but Jan, Feb, Mar etc is straight forward using the Time/Date Variable MMM to convert
Hi Matt,

thanks for the quick answer, appreciate!
The series of numbers I am getting them, but I have really no clue how to compose the variable string in such way I can replace those numbers by something like: Maximum temperature this year was registrated on that particular day in that particular month.
I have read all the template section details, but I'm not able to deliver :lol:

This link will hopefully show the case: https://meteoroerstreek.nl/temperatuur-en-neerslag/

Re: Which variables to use for timestamp

Posted: Sun Feb 20, 2022 12:16 am
by Mattk
Ok so your max temp time stamp is 20220101140237 which is in the format YYYYMMDDhhmmss so the date is 2022 01 01 (1/1/2022) and time is 14 02 37 (14:02:37) and based on 24 hour time would be PM in the afternoon. So try for yourself the following

[th0temp-ymaxtime.ad:--] will return the year 2022, ad is the position within the string from 1 to 4
[th0temp-ymaxtime.ij:--] will return the hour 14, ij is the position within the string from 9 to 10
[th0temp-ymaxtime=apm.ij:--] will return AM/PM notation 2PM, ij is the position within the string from 9 to 10

Maximum temp 15.6 °C occurred at [th0temp-ymaxtime.ij:--]:[th0temp-ymaxtime.kl:--]:[th0temp-ymaxtime.op:--] should give
Maximum temp 15.6 °C occurred at 14:02:37

and if you want 12 hour AM/PM time then include the apm convertor, note apm will give am/pm lower case, APM gives AM/PM upper case

Similar to extracting the date, remembering "ad" is the year position 1 to 4, "ef" is the month position 5 to 6, "gh" is the day/date position

[th0temp-ymaxtime=MMM.ef:--] should give you Jan

There quite a few different ways to display the Date & Time for a specific purpose but the context of all is basically the same

Re: Which variables to use for timestamp

Posted: Sun Feb 20, 2022 12:51 am
by Eckhardt
Mattk wrote: Sun Feb 20, 2022 12:16 am Ok so your max temp time stamp is 20220101140237 which is in the format YYYYMMDDhhmmss so the date is 2022 01 01 (1/1/2022) and time is 14 02 37 (14:02:37) and based on 24 hour time would be PM in the afternoon. So try for yourself the following

[th0temp-ymaxtime.ad:--] will return the year 2022, ad is the position within the string from 1 to 4
[th0temp-ymaxtime.ij:--] will return the hour 14, ij is the position within the string from 9 to 10
[th0temp-ymaxtime=apm.ij:--] will return AM/PM notation 2PM, ij is the position within the string from 9 to 10

Maximum temp 15.6 °C occurred at [th0temp-ymaxtime.ij:--]:[th0temp-ymaxtime.kl:--]:[th0temp-ymaxtime.op:--] should give
Maximum temp 15.6 °C occurred at 14:02:37

and if you want 12 hour AM/PM time then include the apm convertor, note apm will give am/pm lower case, APM gives AM/PM upper case

Similar to extracting the date, remembering "ad" is the year position 1 to 4, "ef" is the month position 5 to 6, "gh" is the day/date position

[th0temp-ymaxtime=MMM.ef:--] should give you Jan

There quite a few different ways to display the Date & Time for a specific purpose but the context of all is basically the same
Matt,

you are my hero! I nailed it, thanks so much for the help, this makes my day.

Greetz from a stormy Netherlands,

Olaf Eckhardt