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

    557 How do I get the current time in Python? The time module The time module provides functions that tell us the time in "seconds since the epoch" as well as other utilities.

  2. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

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

  4. How do I get time of a Python program's execution?

    Oct 13, 2009 · To measure a Python program's execution time, use the time module. Record the start time with time .time () before the code and the end time after. Subtract start from end to …

  5. datetime - ISO time (ISO 8601) in Python - Stack Overflow

    In Python, I would like to take its creation time, and convert it to an ISO time (ISO 8601) string while preserving the fact that it was created in the Eastern Time Zone (ET). How do I take the …

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

  7. Easy way to get the correct time in python - Stack Overflow

    I'd like to put a time-stamp in the output from each job I launch, but obviously the accuracy of the python's time.strftime() etc are going to depend on the machine knowing the correct time. I'd …

  8. In Python, how to display current time in readable format

    Oct 18, 2010 · How can I display the current time as: 12:18PM EST on Oct 18, 2010 in Python. Thanks.

  9. How to get the current time with python - Stack Overflow

    Oct 13, 2020 · How do you get the current time in python? I have seen people get the date and time, but I only want the time as a string. For example, if the current time was 8:30, the …

  10. time - High-precision clock in Python - Stack Overflow

    109 The standard time.time() function provides sub-second precision, though that precision varies by platform. For Linux and Mac precision is +- 1 microsecond or 0.001 milliseconds. Python on …