How can I turn an input date into a readable string in Python?

0 votes
input : 2010-01-28 08:39:49.000003

output i want: 
"January 28, 2010"
How do I do this?
Dec 11, 2018 in Python by charlie_brown
• 7,710 points
29 views

1 answer to this question.

0 votes

The datetime class has a method strftime. strftime() Behavior in the Python docs documents the different formats it accepts.

For this specific example, it would look something like:

my_datetime.strftime("%B %d, %Y")
answered Dec 11, 2018 by ariaholic
• 7,320 points

Related Questions In Python

0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
540 views
0 votes
1 answer
0 votes
1 answer

How do I check if input string is a valid regular expression or not in Python?

Hi. Good question! Well, just like what ...READ MORE

answered Feb 12 in Python by Nymeria
• 3,500 points
39 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,810 points
88 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 124 views
+4 votes
6 answers
0 votes
1 answer

How can I define a multidimensional array in python using ctype?

Here's one quick-and-dirty method: >>> A = ((ctypes.c_float ...READ MORE

answered Oct 9, 2018 in Python by ariaholic
• 7,320 points
202 views
0 votes
1 answer

How can I print an Error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Oct 12, 2018 in Python by ariaholic
• 7,320 points
26 views