(+) Time in Odoo

Source: Internet
Author: User

* in model
From datetime import datetime, Timedelta
Import time

From Openerp.tools import Default_server_date_format, Default_server_datetime_format

The package to be introduced above
Default_server_date_format = "%y-%m-%d"
Default_server_time_format = "%h:%m:%s"
Default_server_datetime_format = "%s%s"% (
Default_server_date_format,
Default_server_time_format)

--------
#没有设定日期, the date on which the system was introduced today
If not date_order:
Date_order = Time.strftime (Default_server_date_format)


* In the View

(+) time in Odoo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.