Skip to Content
Menu
This question has been flagged

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



Avatar
Discard

Is your server time configured correctly?

Author

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

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

Author

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

is timedelta solution good?

Related Posts Replies Views Activity
8
May 23
58359
4
Feb 23
68875
1
Jan 23
1973
6
Sep 19
9024
2
Mar 16
6517