Created
March 21, 2025 08:45
-
-
Save bedilbek/69d6c4950894a6af0549450ea702a95b to your computer and use it in GitHub Desktop.
datetime-now
This file contains 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
#!/usr/bin/python3 | |
import sys | |
from datetime import datetime, timezone | |
import argparse | |
def main(args): | |
time = datetime.now(timezone.utc).replace(tzinfo=None) | |
print(time.isoformat(timespec="milliseconds") + "Z") | |
print(time.timestamp()) | |
print(int(time.timestamp()*1000)) | |
print(int(time.timestamp()*1000*1000)) | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--offset", default=None) | |
args = parser.parse_args() | |
main(args) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment