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
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
Python
How to concatenate datetime.date object and datetime.time object
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
Will Rocisky
#1
How to concatenate datetime.date object and datetime.time object
Aug 5 '08, 09:35 AM
Actually I am trying to save both date and time in one cell but they
are given separately by user.
Steven D'Aprano
#2
Aug 5 '08, 10:15 AM
Re: How to concatenate datetime.date object and datetime.timeob ject
On Tue, 05 Aug 2008 02:25:34 -0700, Will Rocisky wrote:
Actually I am trying to save both date and time in one cell but they are
given separately by user.
What's a "cell"?
I suggest building a datetime.dateti me() object:
>>date = datetime.date(2 008, 8, 5)
>>time = datetime.time(1 9, 54)
>>datetime.date time.combine(da te, time)
datetime.dateti me(2008, 8, 5, 19, 54)
I discovered this by opening an interactive session and calling
help(datetime).
--
Steven
Comment
Post
Cancel
Thomas Wright
#3
Aug 5 '08, 10:25 AM
Re: How to concatenate datetime.date object and datetime.time object
Will Rocisky wrote:
Actually I am trying to save both date and time in one cell but they
are given separately by user.
http://docs.python.org/lib/datetime-datetime.html
indicates that the
function you're looking for is datetime.dateti me.combine(d, t).
HTH!
--
I'm at CAMbridge, not SPAMbridge
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment