Can anyone help me please.
I have this field type date:
2016-01-01 and i want to get the month then convert it to its name.
Need help friends please.
#import datetime library
from datetime import datetime
month = datetime.strptime('2016-01-01', "%Y-%m-%d").strftime('%B')#Converting a string format datetime into datetime() type.
You can use different directives as per your requirement in place of "%B". You can find them \here.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 2/19/16, 5:52 AM|
|Seen: 736 times|
|Last updated: 3/4/16, 7:38 AM|