Re: convert str to datetime
On Monday, 25 June 2012 09:42:27 UTC+1, armagan wrote:
Hi,I'm trying to convert to str to datetime. "date object" must be datetime object. Can you help me?def item_pubdate(self, item): # Yayinlanma Tarihi
if item.delivery_date:
date = item.delivery_date
dt = datetime.combine(date, time())
return dt
else:
return ' '
No, we can't help you. What is `item.delivery_date`? What does `str` have to do with anything? What is the relevance of '"date object" must be datetime object' - is that an error message you are getting? If so, why don't you post the actual traceback, which is full of useful debugging information?
--
DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/SL3qDuQ7N5MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home