Odoo Help

0
5 Answers
1
Avatar

Hilar AK

--Hilar AK--
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Quora:
    

            https://www.quora.com/profile/Hilar-Ak-1

Experienced Odoo developer, Functional Consultant.



Hilar AK
5/17/18, 1:19 AM
import datetime
string = '2018-05-17 10:44:50'
dt = datetime.datetime.strptime(string,'%Y-%m-%d %H:%M:%S')
print dt.time()
print dt.time().hour
print dt.time().minute
# output
10:44:50
10
44
0
francislouie
5/21/18, 9:05 PM

dt = datetime.datetime.strptime(string,'%Y-%m-%d %H:%M:%S')

time = dt.time()

date = dt.date()

0
Aurel Balanay
5/17/18, 1:14 AM

check_in_date = datetime.strptime(check_in, "%Y-%m-%d %H:%M:%S").date()

0
Pujara Geet
5/17/18, 5:28 AM

Hello

from datetime import datetime

date = field.Datetime(string='Date')

On_your_method

get_time = datetime.datetime.strptime(date,'%Y-%m-%d %H:%M:%S')

final_time = get_time.time()

print "final time", final_time


Ask a Question
Writer
Tags
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

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

Test it now