About 497,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. 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.

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

    266 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. 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.

  6. 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?

  7. 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?

  8. python - What is the standard way to add N seconds to …

    Sep 19, 2008 · You cannot simply add number to datetime because it's unclear what unit is used: seconds, hours, weeks... There is timedelta class for manipulations with date and time. …

  9. 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 …

  10. How do I determine if current time is within a specified range …

    How do I determine if current time is within a specified range using Python's datetime module? Asked 13 years, 8 months ago Modified 1 year, 10 months ago Viewed 173k times