Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Date Format

By
JOSEPH O'CONNOR
on 11/27/15, 3:59 AM 275 views

how can i change date format from mmddyy to ddmmyy

1

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 11/27/15, 4:18 AM

Hello friend;

Try this:

datetime.datetime.strptime("01-11-2013", '%m-%d-%Y').strftime('%d/%m/%Y') 

prints "11/01/2013".

If you can't live with the leading zero, try this:

dt = datetime.datetime.strptime("2013-1-25", '%Y-%m-%d')

print '{0}/{1}/{2:02}'.format(dt.month, dt.day, dt.year % 100)

This prints "1/11/13" 

Best Regards.

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/27/15, 3:59 AM
Seen: 275 times
Last updated: 11/27/15, 5:12 AM