About 854,000 results
Open links in new tab
  1. How do I get the current time in Python? - Stack Overflow

    Which version of Python was the original answer given in? Just typing datetime.datetime.now() in my Python 2.7 interactive console (IronPython hasn't updated yet) gives me the same …

  2. How do I get a string format of the current date time, in python?

    Using the new string format to inject value into a string at placeholder {}, value is the current time. Then rather than just displaying the raw value as {}, use formatting to obtain the correct date …

  3. Getting today's date in YYYY-MM-DD in Python? - Stack Overflow

    Since Python 3.9, you can use the built-in zoneinfo library to get timezones. Then once you get today's date as a datetime.datetime object, it's straightforward to convert to a string in the …

  4. How do I get the current time in milliseconds in Python?

    May 13, 2011 · To address the new issue (leap seconds): POSIX time does NOT count leap seconds and time.time() returns POSIX time on most systems supported by Python (if we …

  5. datetime - How to get UTC time in Python? - Stack Overflow

    Apr 11, 2013 · The point is that you may want to change things on the function and for that reason is better stick to datetime object, not using time.time(), You could also use …

  6. Python get current time in right timezone - Stack Overflow

    To get the current time in the local timezone as a naive datetime object: from datetime import datetime naive_dt = datetime.now() If it doesn't return the expected time then it means that …

  7. python - Display the time in a different time zone - Stack Overflow

    Nov 4, 2022 · The current UTC time is: 1800 (rounded to the nearest 10 min) The current US/Eastern time is: 1400 (rounded to the nearest 10 min) (actual Eastern time was 14:03) The …

  8. python - How can I get the current time (now) in UTC? - Stack …

    The portable solution to convert a naive datetime object representing local time to UTC is to use tzlocal.get_localzone() to get the local timezone as pytz tzinfo object – jfs Commented Mar 27, …

  9. How to get min, seconds and milliseconds from datetime.now() in …

    Mar 23, 2012 · python get time in minutes. 829. ... python date time get the current time but with seconds and hour and ...

  10. How can I get or print current datetime of GMT time zone in …

    Aug 31, 2020 · Here I print UTC time zone's current datetime. I want current GMT time zone's datetime by this method. How can I? import datetime dt_utcnow = datetime.datetime.utcnow() …

Refresh