Browse Source

[FIX] utc date

Gogs 7 years ago
parent
commit
86e36141f7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      controllers/main.py

+ 3 - 3
controllers/main.py

@@ -23,7 +23,7 @@ class Purchases(http.Controller):
         Get server date to send
     '''
     def get_server_date(self):
-        return datetime.now().strftime(DATE_FORMAT)
+        return datetime.utcnow().strftime(DATE_FORMAT)
 
     '''
         Get current user information
@@ -346,7 +346,7 @@ class Purchases(http.Controller):
                 'product_qty': float(line.get('quantity')),
                 'price_unit': float(line.get('price'))
             }] for line in cart_items],
-            'date_order': datetime.now().strftime(DATETIME_FORMAT),
+            'date_order': datetime.utcnow().strftime(DATETIME_FORMAT),
             'currency_id': currency_id,
             'pricelist_id': pricelist_id,
             'payment_term_id': payment_term_id,
@@ -657,7 +657,7 @@ class Purchases(http.Controller):
         self.make_info_log('Processing {}'.format(mode))
 
         # Get date
-        date_now = datetime.now().strftime(DATE_FORMAT)
+        date_now = datetime.utcnow().strftime(DATE_FORMAT)
         self.make_info_log('Getting date')
 
         # Get currency