Odoo Help


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.


How to change point of sale date format?

on 1/26/15, 6:20 PM 903 views

In the pos.xml file,  how do I change the date format  to display dd/mm/yyyy ?

    <t t-name="PosTicket">
        <div class="pos-sale-ticket">
            <div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
                Date.CultureInfo.formatPatterns.longTime)"/> <t t-esc="order.get('name')"/></div>
            <br />

Shawn Varghese
On 1/29/15, 4:24 AM

Try this:

<t t-esc="new Date().getDate()+'/'+new Date().getMonth()+1+'/'+new Date().getFullYear()"/>

It's not an elegant way to do it, but seeing as no one else has answered, I thought I'll comment.

I have added +1 to the month because JavaScript starts months from 0-11.

I would recommmend you to test it with different dates to make sure it does not break.

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)


Asked: 1/26/15, 6:20 PM
Seen: 903 times
Last updated: 12/10/15, 11:07 PM