TACC-Cloud / tapis-cli

Next-generation Tapis CLI
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

remove strftime(%s) for getting the current time in "epoch" format #342

Closed johnfonner closed 4 years ago

johnfonner commented 4 years ago

The "%s" format is not specifically supported by datetime.strftime and was being passed up to the system interpreter. This was failing on Windows with the error message "Invalid format string."

From testing in Windows powershell, this PR resolves Issue #338.

datetime.timestamp() was another valid way to get Epoch time in Python3, but it is not compatible with Python2. I think time.time() is sufficient in all cases.

mwvaughn commented 4 years ago

This looks OK to me. The objective of said code was to issue a consistent timestamp, so changing the implementation is not a serious change.