Hello everybody!!!!
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.
Best Regards.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello everybody!!!!
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.
Best Regards.
#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.
Best Regards,
Kalpana Hemnani
Hi Drees,
you should use split method of python
i am consider date as year-month-date
data_value='2016-01-01'
get_month=data_value.split('-)[1]
if get_month=='1':
month_name='january'
if you have such issues issues mail me on virzoteck@gmail.com
Create an account today to enjoy exclusive features and engage with our awesome community!
Înscrie-teRelated Posts | Răspunsuri | Vizualizări | Activitate | |
---|---|---|---|---|
|
2
feb. 22
|
29317 | ||
|
1
ian. 20
|
7374 | ||
|
0
feb. 17
|
2777 | ||
|
1
ian. 16
|
6137 | ||
|
4
ian. 16
|
6126 |
Hello Rihene, Iwould like to do the same,create a custom field with the name of the month of a date. ¿how did you solve it? Thanks