On Tue, May 10, 2016 at 10:19 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > You invoke strftime() [in default: use current time mode], but pass it > a format that is not defined in the documentation (or wasn't in Python 2.7 > which I'm still running). #2 > %s (lowercase) formats the seconds field of the time of day. And worst, > since you don't return the result, it just gets thrown away. #3 >
Sorry to nitpick, but this isn't the case. time.strftime("%S") is what you're talking about (getting the "seconds since beginning of current minute"). There is a "%s" format string, but it's not supported on all platforms; it actually would be more useful here, as it represents the time as seconds since 1970 (aka "Unix time"). Of course, time.time() would still be far more useful here, as you subsequently recommended. ChrisA -- https://mail.python.org/mailman/listinfo/python-list