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

    Use the below sample script to get the current date and time in a Python script and print results on the screen. Create file getDateTime1.py with the below content.

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

    Jun 17, 2019 · In versions of Python after 3.7, the best answer is to use time.perf_counter_ns(). As stated in the docs: time.perf_counter() -> float Return the value (in fractional seconds) of a …

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

    Try not to use python built in functions and variables as local variables (ex: today, year, day). Also, the request from the user is to get today's date in YYYY-MM-DD format.

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

    267 You can use the datetime module for working with dates and times in Python. The strftime method allows you to produce string representation of dates and times with a format you specify.

  5. How can I get the current time (now) in UTC? - Stack Overflow

    This was simplified in Python 3.3 (which supports .astimezone() to set the timezone of a naive datetime object to the local (system) timezone, and further simplified in Python 3.6 which …

  6. How do I get a value of datetime.today() in Python that is …

    In the standard library, there is no cross-platform way to create aware timezones without creating your own timezone class. (Edit: Python 3.9 introduces zoneinfo in the standard library which …

  7. Get Unix time in Python - Stack Overflow

    Feb 26, 2021 · In Python, I want to get the current Unix timestamp and then store the value for the long term and be handled by non-Python systems. (I am not merely trying to compute the …

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

    Apr 11, 2013 · For Python 3, use datetime.now(timezone.utc) to get a timezone-aware datetime, and use .timestamp() to convert it to a timestamp.

  9. How to get current time in python and break up into year, month, …

    May 6, 2015 · I would like to get the current time in Python and assign them into variables like year, month, day, hour, minute. How can this be done in Python 2.7?

  10. Python call datetime current hour? - Stack Overflow

    Sep 24, 2020 · Does this answer your question? How to get current time in python and break up into year, month, day, hour, minute?