About 4,760,000 results
Open links in new tab
  1. Getting today's date in YYYY-MM-DD in Python? - Stack Overflow

    Is there a nicer way than the following to return today's date in the YYYY-MM-DD format?

  2. Format a datetime into a string with milliseconds - Stack Overflow

    I assume you mean you're looking for something that is faster than datetime.datetime.strftime (), and are essentially stripping the non-alpha characters from a utc timestamp.

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

    strftime(time_format) returns the current local time as a string that corresponds to the given time_format. Note: time.strftime() and datetime.strftime() support different directive sets e.g., %z is not supported …

  4. How do I turn a python datetime into a string, with readable format ...

    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 like:

  5. Python datetime formatting without zero-padding - Stack Overflow

    The formatting options available with datetime.strftime() will all zero-pad. You could of course roll you own formatting function, but the easiest solution in this case might be to post-process the result of …

  6. python - Formatting timedelta objects - Stack Overflow

    I have two datetime objects. I need to calculate the timedelta between them and then show the output in a specific format. Alpha_TimeObj = datetime.datetime (int (AlphaTime.strftime ('%Y')), int (Alph...

  7. How to change the datetime format in Pandas - Stack Overflow

    Jan 26, 2016 · Compared to the first answer, I will recommend to use dt.strftime() first, and then pd.to_datetime(). In this way, it will still result in the datetime data type.

  8. python - AttributeError: 'str' object has no attribute 'strftime ...

    Oct 31, 2013 · AttributeError: 'str' object has no attribute 'strftime' Asked 12 years, 1 month ago Modified 6 years, 5 months ago Viewed 265k times

  9. How to use %f with strftime () in Python to get microseconds?

    I'm trying to use strftime() to microsecond precision, which seems possible using %f (as stated here). However when I try the following code: import time import strftime from time print strftime(&...

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

    I have a file. 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 d...