About 51 results
Open links in new tab
  1. datetime from string in Python, best-guessing string format

    Apr 8, 2024 · The function to get a datetime from a string, datetime.strptime(date_string, format) requires a string format as the second argument. Is there a way to build a datetime from a string without …

  2. How to format date string via multiple formats in python

    May 18, 2014 · How to format date string via multiple formats in python Asked 11 years, 9 months ago Modified 4 years, 1 month ago Viewed 79k times

  3. python strptime format with optional bits - Stack Overflow

    Jun 2, 2015 · python strptime format with optional bits Asked 10 years, 8 months ago Modified 1 year, 5 months ago Viewed 38k times

  4. use python datetime.strptime - Stack Overflow

    Mar 10, 2021 · You didn't set the format by using strptime (), you are parsing it, i.e. converting string to datetime object. datetime/date objects will always output YYYY-MM-DD without additional formatting

  5. Datetime strptime in python - Stack Overflow

    datetime.strptime(date_string,date_string_format).strftime(convert_to_date_string_format) To print the date in specified format you need to provide format as below.

  6. python - How do I parse an ISO 8601-formatted date and time? - Stack ...

    Sep 24, 2008 · I need to parse RFC 3339 strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type. I have found strptime in the Python standard library, but it is not very convenient.

  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. Convert timestamps with offset to datetime obj using strptime

    I am trying to convert time-stamps of the format "2012-07-24T23:14:29-07:00" to datetime objects in python using strptime method. The problem is with the time offset at the end(-07:00). Without the

  9. python - datetime.strptime formatting - Stack Overflow

    Oct 6, 2018 · This is done by using datetime.datetime.strptime(). To format the object back into a string you can use the same syntax but using method datetime.datetime.strftime(), e.g.:

  10. Converting a string to a formatted date-time string using Python

    Dec 29, 2009 · For datetime objects, strptime is a static method of the datetime class, not a free function in the datetime module: