I’ve got the date/time example working but cannot find a way to get individual numbers or substrings. The project needs to reset itself at midnight, So I tried looking for a change in day. Generally, I’d like to make use of the individual time/date data variables. Can anyone help?
One of our readers published a sample code some time ago that can help.
Here it is: https://gist.github.com/Tech500/bc4bd77a357b8d401cd13487ef6de800
Hi Sara, I will work through it during this week when time allows.
I’ve had a brief look but need a spare evening to get to grips.
It runs to the point of waiting for the first valid timestamp, and then continues waiting. I think it might only work in the US. There is a link to more clues about the time zone, though they are just clues to me!
What do you mean?
Did you define the TZ variable to use your own timezone?
No I didn’t change that to UK other than trying to fiddle the numbers. I looked at the supporting document but I’m afraid I could not see how to apply my time zone. Is that essential?
You can easily find the timezone string here:https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
If your timezone is London, this is what you should use: