Quantcast
Viewing all articles
Browse latest Browse all 4971

Beginners • Calling Standard Time Via Strftime

Hello,

Is there an easy way to call the standard time of the pi's clock via a script?

Currently to call the current time (either in daylight savings or in standard time) I use Strftime:

Code:

time.strftime('%I:%M:%S %p')
With this I get the actual time whether its corrected for daylight savings or not.

My intention is to allow multiple people to use copies of my program in different places, and the program runs only on standard time. Thus for it to work I must be able to call the standard time, and I can't predict whether or not the location it will be used in, uses daylight savings time.

I can use strictly UTC, but that required additional calculations to get back to standard time for the specific time zone, thus my goal is to go direct to the local standard time.

If anyone knows if this can be done / has the script code used to call the standard time, I would certainty appreciate the help!

Statistics: Posted by mogo4414 — Sat Dec 28, 2024 3:18 am



Viewing all articles
Browse latest Browse all 4971

Trending Articles