About 23,300,000 results
Open links in new tab
  1. python - How to print a date in a regular format? - Stack Overflow

    Nov 22, 2008 · In Python you can format a datetime using the strftime() method from the date, time and datetime classes in the datetime module. In your specific case, you are using the date class from datetime . You can use the following snippet to format the today variable into a string with the format yyyy-MM-dd :

  2. Get current date using Python - GeeksforGeeks

    Dec 11, 2019 · Python library defines a function that can be primarily used to get the current time and datetime.now () function and return the current local date and time, which is defined under the DateTime module. Syntax: datetime.now (tz) Parameters : tz : Specified time zone of which current time and date is required.

  3. Python Dates - W3Schools

    3 days ago · To create a date, we can use the datetime() class (constructor) of the datetime module. The datetime() class requires three parameters to create a date: year, month, day.

  4. Formatting Dates in Python - GeeksforGeeks

    Mar 15, 2024 · Python has a built-in Python Calendar module to work with date-related tasks. Using the module, we can display a particular month as well as the whole calendar of a year. In this article, we will see how to print a calendar month and year using Python.

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

    Sep 9, 2015 · Is there a nicer way than the following to return today's date in the YYYY-MM-DD format? pandas and pendulum alternatives are available for those working with these libraries. Use strftime: To also include a zero-padded Hour:Minute:Second at the end: To get the UTC date and time: how about just time.strftime("%Y-%m-%d")?

  6. How to Get Current Date and Time using Python | GeeksforGeeks

    Dec 11, 2019 · In this article, we will cover different methods for getting data and time using the DateTime module and time module in Python. Different ways to get Current Date and Time using Python. Current time using DateTime object; Get time using the time module; Get Current Date and Time Using the Datetime Module

  7. python - How to print current date on python3? - Stack Overflow

    import datetime now = datetime.datetime.now() print ("Current date and time : ") print (now.strftime("%Y-%m-%d %H:%M:%S"))

  8. Python datetime (With Examples) - Programiz

    Dec 27, 2022 · In this article, you will learn to manipulate date and time in Python with the help of 10+ examples. You will learn about date, time, datetime and timedelta objects. Also, you will learn to convert datetime to string and vice-versa. And, the …

  9. How to print a date in a regular format? - W3docs

    In Python, you can use the datetime module to work with dates and times. To print a date in a regular format, you can use the strftime() method of the datetime object. This method allows you to specify a format string that defines the desired format of the date.

  10. Python: Print current time and date - w3resource

    Apr 16, 2025 · Get Current Date and Time: Use datetime.datetime.now() to create a datetime object representing the current date and time. Display Information: Use the print() function to display a message indicating what is being printed.

  11. Some results have been removed
Refresh