> Can you tell us what is the "[0:6]" supposed to be doing in your time
> conversion funcions?
strptime returns a struct_time[0] which is a 9-tuple.
The datetime constructor takes up to 8 arguments, but the last 2 are microseconds and a tzinfo object, whereas timetuple's indexes 6 to 8 hold respectively the weekday, the yearday and a daylight saving flag (for mktime).
So strptime and datetime are compatible on their first 6 values (return for strptime, input for datetime), hence the slicing of strptime's result to get only the first 6 values.
[0] http://docs.python.org/library/time.html#time.struct_time
--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.
No comments:
Post a Comment