About 435,000 results
Open links in new tab
  1. How do I turn a python datetime into a string, with readable …

    The datetime class has a method strftime. The Python docs documents the different formats it accepts: strftime () and strptime () Behavior For this specific example, it would look something …

  2. python - How to print a date in a regular format? - Stack Overflow

    Oct 7, 2016 · 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 …

  3. datetime - Python 3 How to format to yyyy-mm-ddThh:mm:ssZ

    Mar 6, 2019 · I'm new to Python and I cannot for the life of me find my specific answer online. I need to format a timestamp to this exact format to include 'T', 'Z' and no sub or miliseconds …

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

    Since Python 3.9, you can use the built-in zoneinfo library to get timezones. Then once you get today's date as a datetime.datetime object, it's straightforward to convert to a string in the …

  5. Python: convert datetime format to another - Stack Overflow

    Apr 15, 2019 · In response to your edit strptime takes a string date and converts it into a datetime object. The format you pass to it just tells it how to parse the string to datetime. It does not …

  6. How do I translate an ISO 8601 datetime string into a Python …

    I'm getting a datetime string in a format like "2009-05-28T16:15:00" (this is ISO 8601, I believe). One hackish option seems to be to parse the string using time.strptime and passing the first …

  7. python - Parse date string and change format - Stack Overflow

    Feb 15, 2010 · I have a date string with the format 'Mon Feb 15 2010'. I want to change the format to '15/02/2010'. How can I do this?

  8. datetime - User-friendly time format in Python? - Stack Overflow

    Python: I need to show file modification times in the "1 day ago", "two hours ago", format. Is there something ready to do that? It should be in English.

  9. Date Time Formats in Python - Stack Overflow

    @user1579970 "2013-07-12T07:00:00Z" is a string and d1is a datetime object. You can convert a datetime object to a string in any format you want using strftime() .

  10. How do I get the current time in Python? - Stack Overflow

    Which version of Python was the original answer given in? Just typing datetime.datetime.now() in my Python 2.7 interactive console (IronPython hasn't updated yet) gives me the same …