Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Python only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Python
converting time tuple to datetime struct
converting time tuple to datetime struct
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Michael Jard
#1
converting time tuple to datetime struct
Jul 18 '05, 10:13 PM
there a shorter way then:
datetime.fromti mestamp(time.mk time(time.strpt ime("20-3-2005","%d-%b-%y")))
thanks,
Mike
gry@ll.mit.edu
#2
Jul 18 '05, 10:13 PM
Re: converting time tuple to datetime struct
[your "%b" is supposed to be the abbreviated month name, not the
number. Try "%m"]
In [19]: datetime.dateti me(*time.strpti me("20-3-2005","%d-%m-%Y")[:6])
Out[19]: datetime.dateti me(2005, 3, 20, 0, 0)
Cheers,
George
Comment
Post
Cancel
Michael Jard
#3
Jul 18 '05, 10:14 PM
Re: converting time tuple to datetime struct
Yeah, that was just an oversight while retyping the code. Thanks from
the prompt reply, it was just what I needed.
Mike
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment