Switch to Bing in English
Koppelingen in nieuw tabblad openen
  1. time — Time access and conversions — Python 3.14.2 ...

    Time Functions in Python? - Online Tutori…

    Date, time and date time are an object in Python, so whenever we do any operation on them, we a…

    TutorialsPoint
  1. Python's time module provides various functions to work with time-related tasks, such as reading the current time, formatting time, and suspending execution. Here are some of the most commonly used functions in the time module:

    Getting the Current Time

    To get the current time in seconds since the epoch (January 1, 1970, 00:00:00 UTC), you can use the time.time() function:

    import time

    seconds = time.time()
    print("Seconds since epoch =", seconds)
    Gekopieerd.

    This function returns a floating-point number representing the current time in seconds.

    Converting Time to a Readable Format

    To convert the time in seconds since the epoch to a readable format, you can use the time.ctime() function:

    import time

    seconds = 1672215379.5045543
    local_time = time.ctime(seconds)
    print("Local time:", local_time)
    Gekopieerd.

    This function returns a string representing the local time.

    Suspending Execution

    The time.sleep() function suspends the execution of the current thread for the given number of seconds:

    Feedback
  2. Python time Module - W3Schools

    The time module provides functions for working with time values and delays. Use it to measure elapsed time, add delays, format timestamps, or convert between time representations.

  3. Python Time Module - GeeksforGeeks

    23 jul. 2025 · In this article, we will discuss the time module and various functions provided by this module with the help of good examples. As the name suggests …

  4. time | Python Standard Library – Real Python

    The Python time module provides various time-related functions. It allows you to work with time in a variety of ways, including getting the current time, measuring …

  5. Python Time Functions - TechBeamers

    30 nov. 2025 · Python time functions and their usage explained by our expert with code snippets and examples.

  6. Time Functions in Python? - Online Tutorials Library

    Date, time and date time are an object in Python, so whenever we do any operation on them, we actually manipulate objects not strings or timestamps. In this section we’re going to discuss the “time” module …

  7. Python time Module (with Examples) - Programiz

    1 jan. 1970 · Learn how to use the time module in Python to handle time-related tasks, such as getting the current time, formatting time, sleeping for a specified time, and more. See the syntax and output …

  8. Python Time Function: A Comprehensive Guide - CodeRivers

    26 jan. 2025 · In Python, working with time is an essential part of many applications. Whether you are measuring the performance of a piece of code, scheduling tasks, or dealing with timestamps in data, …

  9. Timing Functions in Python: A Guide | Built In

    5 jun. 2024 · Whether you’re optimizing code for performance or simply want to understand how long it takes for your code to run, several different methods are …

  10. Mastering Python's Built-in time Module - Python Geeks

    31 dec. 2025 · In this article, we will be exploring Python's time module and learning how to use its functions to manipulate time in various ways.

  11. Zoekopdrachten die u mogelijk leuk vindt

Door deze website te gebruiken, gaat u akkoord met ons gebruik van cookies voor analysedoeleinden, inhoud die is aangepast aan uw persoonlijke voorkeur en advertenties.Meer informatie over cookies van derden|Privacybeleid van Microsoft