1) Give a description of the problem
I am trying to convert the new sunrise and sunset times into global variables, since that new data actually show seconds (for accuracy)
2) What is the expected behavior?
$twcweather.conditions.sunriseTimeLocal »»» 2019-03-22T06:56:40-0500
$twcweather.conditions.sunsetTimeLocal »»» 2019-03-22T19:07:28-0500
(Notice the seconds are there at this point)
3) What is happening/not happening?
When I use this code, it does not round, it just deletes the seconds completely:
as seen here:
When I try to get fancy and store it as a string:
I can get all the info into the variable:
but then when I try to convert that into a useful time variable:
… it also deletes the seconds!!
Is it possible to store seconds in a time based variable?!?
Basically, I need a way to get the accurate sunrise and sunset times into global variables, so other pistons can use that time instead of the system variables which do not display seconds.
Any help or guidance would be greatly appreciated.