Odoo Help

Welcome!

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

0

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

By
shameem@aχoncoms
on 11/21/16, 6:31 AM 172 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?

Yenthe
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

shameem@aχoncoms
on 11/21/16, 11:19 PM

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

Yenthe
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?

shameem@aχoncoms
on 11/22/16, 4:50 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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