Odoo Help


Python Current Time has 5:30 loss. What is the good Solution ?

on 11/21/16, 6:31 AM 655 views

Hi guys,

from datetime import datetime
print datetime.now()
Output: 2016-11-21 11:21:36.471784

The time has 5:30 loss. So I solved temporarily

print datetime.now() + timedelta(hours=5.5)

Is it good method?

Why this variation ?

Thanks in advance

Is your server time configured correctly?

on 11/21/16, 9:23 AM

I have set the timezone of administrator to Asia/Kolkata.

But result is same.

System time is 9:46, but time in odoo log is 2016-11-22 04:16:39,697

on 11/21/16, 11:19 PM

Hmm, is is stored in the database in UTC or do you see a difference there too?

on 11/22/16, 4:21 AM

I don't store time in database. I want to get current time to a variable.

is timedelta solution good?

on 11/22/16, 4:50 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/21/16, 6:31 AM
Seen: 655 times
Last updated: 11/21/16, 11:24 PM