On Fri, Mar 27, 2015 at 6:31 PM, Jinghui Niu wrote:
> On Wednesday, March 25, 2015 at 2:17:03 PM UTC-7, Jinghui Niu wrote:
>> I am learning python programming. One thing that gives me a lot of confusion
>> is the division of labours between the time module and the datetime modu
On Wednesday, March 25, 2015 at 2:17:03 PM UTC-7, Jinghui Niu wrote:
> I am learning python programming. One thing that gives me a lot of confusion
> is the division of labours between the time module and the datetime module.
>
> As it turns out to be, time module is not only abou
On 25/03/2015 23:49, Ian Kelly wrote:
On Wed, Mar 25, 2015 at 3:16 PM, Jinghui Niu wrote:
I am learning python programming. One thing that gives me a lot of confusion is
the division of labours between the time module and the datetime module.
As it turns out to be, time module is not only
On Wed, Mar 25, 2015 at 3:16 PM, Jinghui Niu wrote:
> I am learning python programming. One thing that gives me a lot of confusion
> is the division of labours between the time module and the datetime module.
>
> As it turns out to be, time module is not only about time, it's
On Thu, 26 Mar 2015 08:16 am, Jinghui Niu wrote:
> I am learning python programming. One thing that gives me a lot of
> confusion is the division of labours between the time module and the
> datetime module.
>
> As it turns out to be, time module is not only about time, it
I am learning python programming. One thing that gives me a lot of confusion is
the division of labours between the time module and the datetime module.
As it turns out to be, time module is not only about time, it's about date too.
And datetime doesn't natively support timezone, y
Steven D'Aprano writes:
> On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
>
> > Cameron Simpson writes:
> >> Firstly, replace is a verb, and I would normally read
> >> td.replace(microseconds=0) as an instruction to modify td in place.
> >> Traditionally, such methods in python return None
On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
> However, the existing ‘replace’ methods ‘datetime.date.replace’,
> ‘datetime.datetime.replace’, ‘datetime.time.replace’ already work this
> way: they create a new value and return it, without modifying the
> original object.
That's how str.r
In article <52eb1e37$0$29972$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> "replace" is a perfectly reasonable name for a method which performs a
> replacement, whether it replaces in place (for mutable objects) or makes
> a copy with replacement (for immutable objects). What e
On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
> Cameron Simpson writes:
>
>> Hmm. I do not like the replace() as suggested.
>>
>> Firstly, replace is a verb, and I would normally read
>> td.replace(microseconds=0) as an instruction to modify td in place.
>> Traditionally, such methods in
On 31Jan2014 11:35, Ben Finney wrote:
> Cameron Simpson writes:
> > Hmm. I do not like the replace() as suggested.
> >
> > Firstly, replace is a verb, and I would normally read
> > td.replace(microseconds=0) as an instruction to modify td in place.
> > Traditionally, such methods in python return
Cameron Simpson writes:
> Hmm. I do not like the replace() as suggested.
>
> Firstly, replace is a verb, and I would normally read
> td.replace(microseconds=0) as an instruction to modify td in place.
> Traditionally, such methods in python return None.
I agree with this objection. A method that
On 30Jan2014 18:36, Neil Cerutti wrote:
> On 2014-01-30, Roy Smith wrote:
> > I was astounded just now to discover that datetime.timedelta
> > doesn't have a replace() method (at least not in Python 2.7).
> > Is there some fundamental reason why it shouldn't, or is this
> > just an oversight?
> >
On 2014-01-30, Roy Smith wrote:
> I was astounded just now to discover that datetime.timedelta
> doesn't have a replace() method (at least not in Python 2.7).
> Is there some fundamental reason why it shouldn't, or is this
> just an oversight?
>
> My immediate use case was wanting to print a timed
On 30/01/2014 17:32, Roy Smith wrote:
I was astounded just now to discover that datetime.timedelta doesn't
have a replace() method (at least not in Python 2.7). Is there some
fundamental reason why it shouldn't, or is this just an oversight?
My immediate use case was wanting to print a timedelt
I was astounded just now to discover that datetime.timedelta doesn't
have a replace() method (at least not in Python 2.7). Is there some
fundamental reason why it shouldn't, or is this just an oversight?
My immediate use case was wanting to print a timedelta without the
fractions of seconds. The
in 671891 20120210 212545 Olive wrote:
>In the datetime module, it has support for a notion of timezone but is
>it possible to use one of the available timezone (I am on Linux). Linux
>has a notion of timezone (in my distribution, they are stored
>in /usr/share/zoneinfo). I would lik
On Fri, Feb 10, 2012 at 1:25 PM, Olive wrote:
> In the datetime module, it has support for a notion of timezone but is
> it possible to use one of the available timezone (I am on Linux). Linux
> has a notion of timezone (in my distribution, they are stored
> in /usr/share/zoneinfo).
In <20120210222545.4cbe6...@bigfoot.com> Olive writes:
> In the datetime module, it has support for a notion of timezone but is
> it possible to use one of the available timezone (I am on Linux). Linux
> has a notion of timezone (in my distribution, they are stored
> in /usr/
In the datetime module, it has support for a notion of timezone but is
it possible to use one of the available timezone (I am on Linux). Linux
has a notion of timezone (in my distribution, they are stored
in /usr/share/zoneinfo). I would like to be able 1) to know the current
timezone and 2) to be
2010/11/14 Zeynel :
> It's about a week now I've been trying to convert a datetime object to
> seconds since epoch; the object is set to current time by class Rep()
> in Google App Engine:
>
> class Rep(db.Model):
> ...
> mCOUNT = db.IntegerProperty()
> mDATE0 = db.DateTimeProperty(auto_no
Zeynel writes:
> It's about a week now I've been trying to convert a datetime object to
> seconds since epoch; the object is set to current time by class Rep()
> in Google App Engine:
>
> class Rep(db.Model):
> ...
> mCOUNT = db.IntegerProperty()
> mDATE0 = db.DateTimeProperty(auto_no
It's about a week now I've been trying to convert a datetime object to
seconds since epoch; the object is set to current time by class Rep()
in Google App Engine:
class Rep(db.Model):
...
mCOUNT = db.IntegerProperty()
mDATE0 = db.DateTimeProperty(auto_now_add=True)
mWEIGHT = db.Flo
[Max M]
> ...
> First of, it should be possible to easily convert between the
> datetime objects.
Why? All the conversions people asked for when the module was being
designed were implemented.
> And eg. the date object doesn't have a datetime() method. Which
> it could easily have.
But not a *s
Max M wrote:
> Serge Orlov wrote:
>> Max M wrote:
>
>> Yes, you did. datetime.timetuple is those who want *time module*
>> format, you should use datetime.data, datetime.time, datetime.year
>> and so on... As they say, if the only tool you have is timetuple, everything
>> looks like tuple Try this
Serge Orlov wrote:
Max M wrote:
Yes, you did. datetime.timetuple is those who want *time module* format, you should use datetime.data, datetime.time, datetime.year
and so on...
As they say, if the only tool you have is timetuple, everything looks like tuple
Try this:
dt = datetime(2005, 1, 1,
Max M wrote:
> # -*- coding: latin-1 -*-
>
> """
>
> I am currently using the datetime package, but I find that the design
> is oddly
> asymmetric. I would like to know why. Or perhaps I have misunderstood
> how it should be used?
Yes, you did. datetime.timetuple is those who want *time module* fo
guments (9 given)
>>> d1.timetuple()
(2005, 1, 1, 12, 13, 10, 5, 1, -1)
Because if I subclass datetime, I often need to convert between my
subclass and
the built in datetime module. But there is no direct way to do it.
Instead I have to do it in a somewhat more clunky way:
[EMAIL PROTECTED] wrote:
I am writing a script that acts as an AIM bot [using twisted.IM's base
scripts] and I want to add a logging feature. I got it to log who sends
what to whom, but what I want to add is the date and time that the
message was sent (or recieved by the bot), I tried to look at da
take a look at the logging module as well, in the documentation
(paragraph 6.29.2 for release 2.4) you find a basic example
--
http://mail.python.org/mailman/listinfo/python-list
The time module will do.
>>> import time
>>> time.ctime()
'Mon Jan 10 11:17:54 2005'
Use strftime if you need to format the time differently.
>>> time.strftime("%Y-%m-%d %H:%m:%S",time.localtime())
'2005-01-10 11:01:45'
On 9 Jan 2005 21:46:12 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
I am writing a script that acts as an AIM bot [using twisted.IM's base
scripts] and I want to add a logging feature. I got it to log who sends
what to whom, but what I want to add is the date and time that the
message was sent (or recieved by the bot), I tried to look at datetime
on my own, and I c
Eric Azarcon wrote:
I'm fairly new to Python, and was wondering if someone might be able to
help. I'm doing something that requires the datetime module released in
2.3. Unfortunately, the target machines are running 2.2.x and there is
no easy way that I know of to install 2.3/2.4 (RHEL
Hello!
I'm fairly new to Python, and was wondering if someone might be able to
help. I'm doing something that requires the datetime module released in
2.3. Unfortunately, the target machines are running 2.2.x and there is
no easy way that I know of to install 2.3/2.4 (RHEL ES).
I
34 matches
Mail list logo