multiclock.py 538 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/local/bin/python3
  2. #
  3. # this script will show time and date in different locations
  4. # Author: Anton TETERIN
  5. # web: https://2dz.fi
  6. #
  7. # 2024-04-28 * init /A
  8. from datetime import datetime
  9. import pytz
  10. ts_utc = pytz.utc
  11. zones = [
  12. "UTC",
  13. "Europe/Dublin",
  14. "Europe/Madrid",
  15. "Europe/Paris",
  16. "Europe/Helsinki",
  17. "Europe/Moscow",
  18. "Asia/Riyadh",
  19. "Asia/Dubai",
  20. "Asia/Sakhalin"
  21. ]
  22. for zone in zones:
  23. ts = pytz.timezone(zone)
  24. print ( " ", datetime.now(ts).strftime("%Y-%m-%d %H:%M:%S"), " in ", ts )