Format date and time

I need to format date and time in Print Formats. I use but I got something like 2016-04-04 15:47:33.217346 wich is not what I want.
How can I format date and time depending on user’s locale?

@emakis use doc.get_formatted('fieldname')


Hi @max_morais_dmm,

I don’t need a ‘fieldname’ I just need the current date and current time, at the moment the user prints the doctype… I also tried doc.formatted( but didn’t work.
Any other suggestion?

1 Like


If you want current date and current time using

you have to split Date and Time using jinja template. Try below script

{% set date =' ')[0] %} 
{% set time =' ')[1] %}
Date = {{ date }} <br />
Time = {{ time }}

@emakis, is a bit more complex, by the way is:

{{ frappe.format_value(, {'fieldtype': 'Date'}) }}