On Aug 22, 5:11 pm, Kushal Kumaran
wrote:
> On Fri, Aug 21, 2009 at 11:44 PM, Ronn Ross wrote:
> > I'm new to python and I'm getting a date time from a field in the database
> > that looks like this:
> > 8/2/2009 8:36:16 AM (UTC)
> datetime.datetime.strptime() will give you a datetime object, whi
On Fri, Aug 21, 2009 at 11:44 PM, Ronn Ross wrote:
> I'm new to python and I'm getting a date time from a field in the database
> that looks like this:
> 8/2/2009 8:36:16 AM (UTC)
>
> I want to split it into two fields one with the date formatted like this:
> -MM-DD 2009-08-02
>
> and the time
On Fri, 21 Aug 2009 14:43:55 -0400
Ronn Ross wrote:
> On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> > You don't say what database you are using but you may find it simpler
> > to do the conversion in your SELECT statement. For example, see
> > http://www.postgresql.org/docs/8.3/stat
On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain wrote:
> On Fri, 21 Aug 2009 14:14:32 -0400
> Ronn Ross wrote:
> > I want to split it into two fields one with the date formatted like this:
> > -MM-DD 2009-08-02
> >
> > and the time to be 24 hour or military time. How every you call it.
>
On Fri, 21 Aug 2009 14:14:32 -0400
Ronn Ross wrote:
> I want to split it into two fields one with the date formatted like this:
> -MM-DD 2009-08-02
>
> and the time to be 24 hour or military time. How every you call it. Similar
> to this:
> 15:22:00
>
> I found it easy to truncate off the (
I'm new to python and I'm getting a date time from a field in the database
that looks like this:
8/2/2009 8:36:16 AM (UTC)
I want to split it into two fields one with the date formatted like this:
-MM-DD 2009-08-02
and the time to be 24 hour or military time. How every you call it. Similar
t
On 2009-02-10 10:26, Phillip B Oldham wrote:
> Is there a simple way to set a date/time and convert it to a unix
> timestamp? After some googling I found the following:
>
> t = datetime.time(7,0,0)
> starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
>
> That seems like very long-winded. I
the python routines are a bit basic - you really have to think quite hard
about what you are doing to get the right answer.
in your case, you need to be clear what the timezone is for the datetime
you are using. timezone info is optional (see the datetime documentation,
where it talks about "nai
Phillip B Oldham schrieb:
Is there a simple way to set a date/time and convert it to a unix
timestamp? After some googling I found the following:
t = datetime.time(7,0,0)
starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
That seems like very long-winded. Is there an easier way? I've rea
Is there a simple way to set a date/time and convert it to a unix
timestamp? After some googling I found the following:
t = datetime.time(7,0,0)
starttime = time.mktime(t.timetuple())+1e-6*t.microsecond
That seems like very long-winded. Is there an easier way? I've read
the docs on the datetime a
10 matches
Mail list logo