Created
April 3, 2023 11:17
-
-
Save mezhgano/10081e52e56915b2783eb91361271a79 to your computer and use it in GitHub Desktop.
Convert epoch to datetime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def _epoch_to_datetime(self, epoch:int, strf='%Y-%m-%d_%H-%M-%S') -> str: | |
'Return human readable datetime string from given epoch int.' | |
return datetime.fromtimestamp(epoch).strftime(strf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment