in on_change when you will pass a date it will be in string type. So you can perform all string operation on it directly. in other case if you get in datetime type simply convert it into string type by str(date) then you can perform string operation on it.
here you need to do this :
def on_change(self, cr, uid, ids, date):
time = date[10:]
enter your code here
Instead of hard-coding with date[10:].
You could get the hour-minute in various formats
## 12 hour format ##
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
|Asked: 6/28/13, 6:04 PM|
|Seen: 4512 times|
|Last updated: 3/16/15, 8:10 AM|