On 13/11/2013 00:37, Dennis Lee Bieber wrote:
On Wed, 13 Nov 2013 09:42:38 +1100, Chris Angelico
declaimed the following:
Plus, they switch clocks at 2am all the time, not at 2am forward and
3am backward.
2AM is the time at which US switches occur also, in either direction.
The di
In article ,
Alister wrote:
> > Best practices say to move the value from local time to UTC as soon as
> > possible, then store/use the UTC time internally for all operations.
> > Only when it's about to be presented to the user should you convert it
> > back to local time if you need to.
> >
On Wed, Nov 13, 2013 at 11:30 AM, Dennis Lee Bieber
wrote:
> On Tue, 12 Nov 2013 13:02:58 +1100, Chris Angelico
> declaimed the following:
>
>>On Tue, Nov 12, 2013 at 12:59 PM, Dennis Lee Bieber
>> wrote:
>>> Of course, I'm spoiled... My /watch/ has a dial for UTC, along with
>>> one
>>>
On Wed, Nov 13, 2013 at 6:14 AM, Joel Goldstick
wrote:
> In the US, the state of Indiana is really weird. Three separate time
> zone areas, that don't all flip in the same way. See this for TZ
> hell: http://en.wikipedia.org/wiki/Indiana_time_zones
Timezones are one of the most interesting [1]
On Tue, 12 Nov 2013 17:57:55 +0200, Ferrous Cranus wrote:
> or perhaps by confiruing the timezone of the server to use Greece's
> TimeZone by issuing a linux command?
If you have that degreee of control over the server, yes, but UTC is
always safer, because if you need to move your server to a d
On Tue, 12 Nov 2013 12:47:58 +, Andy Lawton wrote:
> (I think "Europe/Kiev" is Greece but I don't know)
I suspect Nick is really in a coding sweatshop in "Asia/Mumbai"
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Nov 12, 2013 at 2:09 PM, MRAB wrote:
> On 12/11/2013 16:12, Tim Chase wrote:
>>
>> On 2013-11-12 17:57, Ferrous Cranus wrote:
>>>
>>> > Best practices say to move the value from local time to UTC as
>>> > soon as possible, then store/use the UTC time internally for all
>>> > operations. O
On 12/11/2013 16:12, Tim Chase wrote:
On 2013-11-12 17:57, Ferrous Cranus wrote:
> Best practices say to move the value from local time to UTC as
> soon as possible, then store/use the UTC time internally for all
> operations. Only when it's about to be presented to the user
> should you conver
On 12/11/2013 16:12, Tim Chase wrote:
Regardless of the server's configured TZ, best practice still says to
normalize everything to UTC (ESPECIALLY if Greece uses the
abomination of DST that we suffer here in the US) as soon as
possible and keep it that way for as long as possible.
-tkc
Why
On Tue, 12 Nov 2013 09:54:44 -0600, Tim Chase wrote:
> On 2013-11-12 17:24, Ferrous Cranus wrote:
>> But what of the server was in California and i live in Greece?
>>
>> How would datetime.now() work then?
>
> Best practices say to move the value from local time to UTC as soon as
> possible, the
On Nov 12, 2013, at 10:57 AM, Ferrous Cranus wrote:
> Στις 12/11/2013 5:54 μμ, ο/η Tim Chase έγραψε:
>> On 2013-11-12 17:24, Ferrous Cranus wrote:
>>> But what of the server was in California and i live in Greece?
>>>
>>> How would datetime.now() work then?
>>
>> Best practices say to move the
On 2013-11-12 17:57, Ferrous Cranus wrote:
> > Best practices say to move the value from local time to UTC as
> > soon as possible, then store/use the UTC time internally for all
> > operations. Only when it's about to be presented to the user
> > should you convert it back to local time if you ne
Στις 12/11/2013 5:54 μμ, ο/η Tim Chase έγραψε:
On 2013-11-12 17:24, Ferrous Cranus wrote:
But what of the server was in California and i live in Greece?
How would datetime.now() work then?
Best practices say to move the value from local time to UTC as soon
as possible, then store/use the UTC
On 2013-11-12 17:24, Ferrous Cranus wrote:
> But what of the server was in California and i live in Greece?
>
> How would datetime.now() work then?
Best practices say to move the value from local time to UTC as soon
as possible, then store/use the UTC time internally for all
operations. Only whe
Στις 12/11/2013 4:57 μμ, ο/η Chris Angelico έγραψε:
On Wed, Nov 13, 2013 at 1:12 AM, Ferrous Cranus wrote:
Joel i must thank you for your help.
I cannot believe it was so simple.
Tnhe server is self aware of its location so why use utcnow() + timedelte(
some_digit_here ) when you can just use
On Wed, Nov 13, 2013 at 1:12 AM, Ferrous Cranus wrote:
> Joel i must thank you for your help.
>
> I cannot believe it was so simple.
>
> Tnhe server is self aware of its location so why use utcnow() + timedelte(
> some_digit_here ) when you can just use just now()
Did you ever go and look at the
In article ,
Grant Edwards wrote:
> On 2013-11-11, Mark Lawrence wrote:
> > On 11/11/2013 23:21, mm0fmf wrote:
> >> On 11/11/2013 19:39, Ethan Furman wrote:
> >>> On 11/11/2013 11:19 AM, Denis McMahon wrote:
> On Mon, 11 Nov 2013 11:57:36 +0200, ?? ??
> wr
Στις 12/11/2013 4:03 μμ, ο/η Joel Goldstick έγραψε:
On Tue, Nov 12, 2013 at 8:32 AM, Ferrous Cranus wrote:
Στις 12/11/2013 2:47 μμ, ο/η Andy Lawton έγραψε:
Firstly , I should clarify I have no idea how to program python, I
joined this mailing list in anticipation of learning soon. And
thought
On Tue, Nov 12, 2013 at 8:32 AM, Ferrous Cranus wrote:
> Στις 12/11/2013 2:47 μμ, ο/η Andy Lawton έγραψε:
>>
>> Firstly , I should clarify I have no idea how to program python, I
>> joined this mailing list in anticipation of learning soon. And
>> thought I'd have a go playing around with your cod
Στις 12/11/2013 2:47 μμ, ο/η Andy Lawton έγραψε:
Firstly , I should clarify I have no idea how to program python, I
joined this mailing list in anticipation of learning soon. And
thought I'd have a go playing around with your code and code given to
you (worst possible place to start, I'm sure)
B
Firstly , I should clarify I have no idea how to program python, I joined
this mailing list in anticipation of learning soon. And thought I'd have a
go playing around with your code and code given to you (worst possible
place to start, I'm sure)
But from the answers already given to you, this seem
Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε:
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line manually when time changes?
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
On 12/11/2013 07:25, alex23 wrote:
On 12/11/2013 2:49 PM, Grant Edwards wrote:
Don't forget that there are also some differences between American and
Imperial whitespace. Since it's ASCII whitespace, you should probably
assume American...
>>> sys.getsizeof(' ')
34
>>> sys.getsizeof(u' ')
52
On Tue, Nov 12, 2013 at 6:25 PM, alex23 wrote:
> On 12/11/2013 2:49 PM, Grant Edwards wrote:
>>
>> Don't forget that there are also some differences between American and
>> Imperial whitespace. Since it's ASCII whitespace, you should probably
>> assume American...
>
>
sys.getsizeof(' ')
> 34
On 12/11/2013 2:49 PM, Grant Edwards wrote:
Don't forget that there are also some differences between American and
Imperial whitespace. Since it's ASCII whitespace, you should probably
assume American...
>>> sys.getsizeof(' ')
34
>>> sys.getsizeof(u' ')
52
bad by design
--
https://mail.python
On 2013-11-11, Mark Lawrence wrote:
> On 11/11/2013 23:21, mm0fmf wrote:
>> On 11/11/2013 19:39, Ethan Furman wrote:
>>> On 11/11/2013 11:19 AM, Denis McMahon wrote:
On Mon, 11 Nov 2013 11:57:36 +0200, ?? ??
wrote:
>> lastvisit = ( datetime.utcnow()
On Tue, Nov 12, 2013 at 12:59 PM, Dennis Lee Bieber
wrote:
> Of course, I'm spoiled... My /watch/ has a dial for UTC, along with
> one
> for 24-hour indication (one hand, range 1 to 24)
Heh. Mine doesn't, so I bought myself a second watch and set it to
UTC. So my left hand has local time
On 11/11/2013 23:21, mm0fmf wrote:
On 11/11/2013 19:39, Ethan Furman wrote:
On 11/11/2013 11:19 AM, Denis McMahon wrote:
On Mon, 11 Nov 2013 11:57:36 +0200, Νίκος Αλεξόπουλος wrote:
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%d %H:%M:%S' )# MySQL datetime
On 11/11/2013 19:39, Ethan Furman wrote:
On 11/11/2013 11:19 AM, Denis McMahon wrote:
On Mon, 11 Nov 2013 11:57:36 +0200, Νίκος Αλεξόπουλος wrote:
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%d %H:%M:%S' )# MySQL datetime format
Someone has an idea what t
On Mon, Nov 11, 2013 at 5:49 PM, wrote:
> On Friday, November 8, 2013 3:06:33 PM UTC-7, Joel Goldstick wrote:
>> rurpy? can you help?
>
> No, sorry. For your future reference, if there is a
> question I can help with (have the technical knowledge,
> haven't seen a good answer yet, have time, et
On Friday, November 8, 2013 3:06:33 PM UTC-7, Joel Goldstick wrote:
> rurpy? can you help?
No, sorry. For your future reference, if there is a
question I can help with (have the technical knowledge,
haven't seen a good answer yet, have time, etc) I will
post my attempt at an answer.
So lack
On 2013-11-11, Ethan Furman wrote:
> On 11/11/2013 11:19 AM, Denis McMahon wrote:
>> On Mon, 11 Nov 2013 11:57:36 +0200, ?? ?? wrote:
>>
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%d %H:%M:%S' )# MySQL datetime format
>>
>>
On 11/11/2013 11:19 AM, Denis McMahon wrote:
On Mon, 11 Nov 2013 11:57:36 +0200, Νίκος Αλεξόπουλος wrote:
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%d %H:%M:%S' )# MySQL datetime format
Someone has an idea what to add to this line to automatically adjust
On Mon, 11 Nov 2013 11:57:36 +0200, Νίκος Αλεξόπουλος wrote:
>> lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
>> '%y-%m-%d %H:%M:%S' )# MySQL datetime format
> Someone has an idea what to add to this line to automatically adjust
> itself if DST happens?
Yes, but the sc
So this is a physics joke. The engineers and physicists at the
conference went to dinner. They ordered wine with dinner. The wait
person asked: "Would you like the small liter, or the large liter?"
--
Joel Goldstick
http://joelgoldstick.com
--
https://mail.python.org/mailman/listinfo/python
On Tue, Nov 12, 2013 at 1:14 AM, Roy Smith wrote:
> We've got a data supplier who (for reasons I cannot fathom), runs their
> network in local time. Every time we talk to them about problems, it's
> a mess just trying to figure out what time we're talking about. We say,
> "we saw a latency spike
In article ,
Joel Goldstick wrote:
> Why not display UTC? If it is so important to you to display local
> time, why do you think that your host's local time is something that
> is useful for a visitor?
In general, it makes sense to run servers (and log everything) in UTC,
and display local ti
On Mon, Nov 11, 2013 at 4:57 AM, Νίκος Αλεξόπουλος
wrote:
> Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε:
>
>> Is there someway to write the following line even better with the
>> ability to detect daylight saving time by itself so i don't have to
>> alter the line manually when time chan
Στις 8/11/2013 11:11 μμ, ο/η Νίκος Αλεξόπουλος έγραψε:
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line manually when time changes?
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
On Sat, 09 Nov 2013 15:43:53 +0200, Νίκος Αλεξόπουλος wrote:
> Στις 9/11/2013 2:45 μμ, ο/η Mark Lawrence έγραψε:
>> On 08/11/2013 23:02, Νίκος Αλεξόπουλος wrote:
>>> Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
> I sa
On Sunday 10 November 2013 04:06:06 Chris Angelico did opine:
> On Sun, Nov 10, 2013 at 11:55 AM, Gene Heskett wrote:
> > On Saturday 09 November 2013 19:52:52 Chris Angelico did opine:
> >> :) Don't just thank me, Grant and Roy were key to it too - and the
> >>
> >> whole "there's no shortage o
On Sun, Nov 10, 2013 at 11:55 AM, Gene Heskett wrote:
> On Saturday 09 November 2013 19:52:52 Chris Angelico did opine:
>> :) Don't just thank me, Grant and Roy were key to it too - and the
>> whole "there's no shortage of newlines" thing started with Steven
>> D'Aprano (I think), and it's a ripe
On Saturday 09 November 2013 19:52:52 Chris Angelico did opine:
> On Sun, Nov 10, 2013 at 2:39 AM, Gene Heskett wrote:
> > Ya know, folks like Nick would have me signing off. Fortunately there
> > are kill files. But the backscatter he creates I am still forced to
> > read, or more usually skip.
On Sun, Nov 10, 2013 at 2:39 AM, Gene Heskett wrote:
> Ya know, folks like Nick would have me signing off. Fortunately there are
> kill files. But the backscatter he creates I am still forced to read, or
> more usually skip.
>
> Then one of you frustrated standup comics comes along, and gives me
On Saturday 09 November 2013 10:33:57 Chris Angelico did opine:
> On Sat, Nov 9, 2013 at 9:29 AM, Grant Edwards
wrote:
> > It's that global newline shortage again. Just because a few people
> > get killed in a newline mine they all go on strike...
>
> It's a conspiracy! The government kills a
In article ,
Chris Angelico wrote:
> On Sat, Nov 9, 2013 at 9:29 AM, Grant Edwards wrote:
> > It's that global newline shortage again. Just because a few people
> > get killed in a newline mine they all go on strike...
>
> It's a conspiracy! The government kills a few miners (with their
> con
On Sat, Nov 9, 2013 at 9:29 AM, Grant Edwards wrote:
> It's that global newline shortage again. Just because a few people
> get killed in a newline mine they all go on strike...
It's a conspiracy! The government kills a few miners (with their
contrail mind-control stuffo) to push the price of ne
Στις 9/11/2013 2:45 μμ, ο/η Mark Lawrence έγραψε:
On 08/11/2013 23:02, Νίκος Αλεξόπουλος wrote:
Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have
On Sat, Nov 9, 2013 at 11:45 PM, Mark Lawrence wrote:
> Why is Web Security for Dummies missing?
Because a Dummy can host a web (all you have to do is invite a spider
into your house and let it do the work), but he won't be able to make
it secure.
Or, more succinctly: Because it isn't.
ChrisA
-
On 08/11/2013 23:02, Νίκος Αλεξόπουλος wrote:
Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
P
On 08/11/2013 23:02, Νίκος Αλεξόπουλος wrote:
Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
P
On Sat, Nov 9, 2013 at 10:02 AM, Νίκος Αλεξόπουλος
wrote:
> Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
>
>> On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
>>
>>> I saw the link and i'm wondering if it can be written in 1-liner.
>>
>>
>> Yes, but you have to rewrite all your c
On 2013-11-08 23:02, Νίκος Αλεξόπουλος wrote:
Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
P
Στις 9/11/2013 12:49 πμ, ο/η Denis McMahon έγραψε:
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
Please tell me and as a git i will provide you w
On Sat, 09 Nov 2013 00:01:37 +0200, Νίκος Αλεξόπουλος wrote:
> I saw the link and i'm wondering if it can be written in 1-liner.
Yes, but you have to rewrite all your code in perl to do this.
--
Denis McMahon, denismfmcma...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-11-08, ?? ?? wrote:
>>> Is there someway to [...]
>> http://stackoverflow.com/[...]
> I saw the link and i'm wondering if it can be written in 1-liner.
> Don't get me wrong but i had the lastvisit calculated on 1 statement
> and i want to retain it this way.
On 08/11/2013 22:01, Νίκος Αλεξόπουλος wrote:
Στις 8/11/2013 11:29 μμ, ο/η Mark Lawrence έγραψε:
On 08/11/2013 21:11, Νίκος Αλεξόπουλος wrote:
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line man
rurpy? can you help?
On Fri, Nov 8, 2013 at 5:01 PM, Νίκος Αλεξόπουλος wrote:
> Στις 8/11/2013 11:29 μμ, ο/η Mark Lawrence έγραψε:
>>
>> On 08/11/2013 21:11, Νίκος Αλεξόπουλος wrote:
>>>
>>> Is there someway to write the following line even better with the
>>> ability to detect daylight saving t
Στις 8/11/2013 11:29 μμ, ο/η Mark Lawrence έγραψε:
On 08/11/2013 21:11, Νίκος Αλεξόπουλος wrote:
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line manually when time changes?
lastvisit = ( datetim
On 08/11/2013 21:11, Νίκος Αλεξόπουλος wrote:
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line manually when time changes?
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%
Is there someway to write the following line even better with the
ability to detect daylight saving time by itself so i don't have to
alter the line manually when time changes?
lastvisit = ( datetime.utcnow() + timedelta(hours=2) ).strftime(
'%y-%m-%d %H:%M:%S' )# MySQL datetime format
Albert Hopkins writes:
> No, I meant "cleaning up the standard library in spite of
> incompatibilities" was one of the goals of Python3 (PEP 3108).
Ah, okay. That PEP is “Standard Library Reorganization”
http://www.python.org/dev/peps/pep-3108/>, and is specifically
about removing or renaming mo
Thanks, Rami, that will work.
V
On Sat, Oct 31, 2009 at 4:54 AM, Albert Hopkins wrote:
> On Sat, 2009-10-31 at 20:34 +1100, Ben Finney wrote:
> > Fixing ‘time’, ‘datetime’, and ‘calendar’ was the reason for Python 3?
> > No, it wasn't.
> >
> > Or perhaps you mean that any backward-incompatible ch
On Sat, 2009-10-31 at 20:34 +1100, Ben Finney wrote:
> Fixing ‘time’, ‘datetime’, and ‘calendar’ was the reason for Python 3?
> No, it wasn't.
>
> Or perhaps you mean that any backward-incompatible change was a reason
> to have Python 3? Even more firmly no. The extent of changes was
> severely li
Albert Hopkins writes:
> On Sat, 2009-10-31 at 10:08 +1100, Ben Finney wrote:
> > Yes, it would be nice if the ‘time’, ‘datetime’, and ‘calendar’
> > modules were all much more unified and consumed a common set of
> > primitive date+time types. It's a wart, and fixing it would
> > (unfortunately)
On Sat, 2009-10-31 at 10:08 +1100, Ben Finney wrote:
> The ‘datetime’ module focusses on individual date+time values (and the
> periods between them, with the ‘timedelta’ type).
>
> For querying the properties of the calendar, use the ‘calendar’
> module.
>
> Yes, it would be nice if the ‘time’,
Victor Subervi writes:
> What I need to calculate is the length of days in the given month. How
> do I do that?
The ‘datetime’ module focusses on individual date+time values (and the
periods between them, with the ‘timedelta’ type).
For querying the properties of the calendar, use the ‘calendar
On Fri, 30 Oct 2009 13:03:32 -0700, Victor Subervi
wrote:
Hi;
I have this code:
today = datetime.date.today()
day = today.day
mo = today.month
yr = today.year
Works great. What I need to calculate is the length of days in the
given month. How do I do that?
TIA,
Victor
Off the top of my h
Hi;
I have this code:
today = datetime.date.today()
day = today.day
mo = today.month
yr = today.year
Works great. What I need to calculate is the length of days in the
given month. How do I do that?
TIA,
Victor
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 6, 2009 at 7:24 AM, wrote:
> Just curious if this is the best way to get the first 3 letters of the
> current month?
>
import datetime
d = datetime.date.today()
m = d.strftime("%B")[:3].upper()
m
> 'MAR'
I believe you want the lowercase version, "%b" (Locale
Just curious if this is the best way to get the first 3 letters of the current
month?
>>> import datetime
>>>
>>> d = datetime.date.today()
>>> m = d.strftime("%B")[:3].upper()
>>> m
'MAR'
Thanks.
Jay
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 14, 4:22 pm, "Demel, Jeff" <[EMAIL PROTECTED]> wrote:
> I'm having trouble finding exactly what I need by googling, so thought
> I'd try to get a quick answer from the group. This seems like something
> that should be dead simple.
>
> I need to generate a string value of a date in the for
I'm having trouble finding exactly what I need by googling, so thought
I'd try to get a quick answer from the group. This seems like something
that should be dead simple.
I need to generate a string value of a date in the format MMDD that
is 97 days in the future. The datetime module is bran
On Tue, 2006-11-14 at 09:33 -0600, Kevin Kelley wrote:
> import time
> FORMAT='%Y%m%d'
>
> time.strftime(FORMAT,time.gmtime(time.time()+8380800))
> output = '20070219'
While the above works, the following variation using datetime is more
readable:
>>> import datetime
>>> someday = datetime.date.
Perfect. Thanks a million.
.strftime was the method I was looking for.
-Jeff
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Kevin Kelley
Sent: Tuesday, November 14, 2006 9:34 AM
To: python-list@python.org
Subject: Re: Noob | datetime question
import timeFORMAT='%Y%m%d'time.strftime(FORMAT,time.gmtime(time.time()+8380800))output = '20070219'--Kevin KelleyOn 11/14/06, Demel, Jeff
<[EMAIL PROTECTED]> wrote:
I'm having trouble finding exactly what I need by googling, so thoughtI'd try to get a quick answer from the group. This seems like
Ah, true. Sorry. I got thrown by the ouput after the line got executed and assumed it was the value of a.
thanks,
Rama
On 03/08/06, Simon Brunning <[EMAIL PROTECTED]> wrote:
On 8/3/06, Rama <[EMAIL PROTECTED]> wrote:
> Just curious why when> I call id(a) I get the same id after I call the repla
On 8/3/06, Rama <[EMAIL PROTECTED]> wrote:
> Just curious why when
> I call id(a) I get the same id after I call the replace method.
In your example, you called a's replace() method, but did nothing with
the new datetime object that it returned. The original object, a,
naturally still has the same
datetime objects are immutable. You can't change the value of anexisting datetime object, only create a new one.
Um.. then how do I get the same ID when I call the replace method?
>>> a = datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)>>> b = a + datetime.timedelta(days=-2, hours=-4)>>>
On 8/3/06, Rama <[EMAIL PROTECTED]> wrote:
> But wont this create a new object? Whereas if you want to modify the same
> object, should we not be using replace? Or does it not matter in the global
> picture?
datetime objects are immutable. You can't change the value of an
existing datetime object,
> In a datetime object I would like to change days and hours.you'd been pointed to the resources yesterday - please read manuals
carefully!a = datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)b = a + datetime.timedelta(days=-2, hours=-4)
But wont this create a new object? Whereas if you wa
Lad schrieb:
> In a datetime object I would like to change days and hours.
> Or in other words, I would like to copy this datetime object but
> increase days and hours.
> Is it possible?
> For example:If I have a datetime object like this
> datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)
>
> I w
In <[EMAIL PROTECTED]>, Lad wrote:
> In a datetime object I would like to change days and hours.
> Or in other words, I would like to copy this datetime object but
> increase days and hours.
> Is it possible?
> For example:If I have a datetime object like this
> datetime.datetime(2006, 8, 3, 14, 1
the datetime object appears to have a replace method which could achieve what you want to do, albeith with some computation from your end first,
>>> d = datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)>>> dir(d)['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribut
In a datetime object I would like to change days and hours.
Or in other words, I would like to copy this datetime object but
increase days and hours.
Is it possible?
For example:If I have a datetime object like this
datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)
I would like to make a new ,for
:-)
Thanks.
Philippe
Scott David Daniels wrote:
> Jorge Godoy wrote:
>> Philippe Martin wrote:
>>
>>> I need to get the date and time under Windows and Linux but need the
>>> information visible to the user (cannot find my words) not the sytem
>>> information (ex: a PC setup on greenwich but
Jorge Godoy wrote:
> Philippe Martin wrote:
>
>> I need to get the date and time under Windows and Linux but need the
>> information visible to the user (cannot find my words) not the sytem
>> information (ex: a PC setup on greenwich but the date/time displayed are
>> relative to some other place.
Thanks, yes, I guess the question is ... what date/time is it looking at ?
and is it the same under various OSs ?
Philippe
Jorge Godoy wrote:
> Philippe Martin wrote:
>
>> Hi,
>>
>> I need to get the date and time under Windows and Linux but need the
>> information visible to the user (canno
Philippe Martin wrote:
> Hi,
>
> I need to get the date and time under Windows and Linux but need the
> information visible to the user (cannot find my words) not the sytem
> information (ex: a PC setup on greenwich but the date/time displayed are
> relative to some other place.
Something like t
Hi,
I need to get the date and time under Windows and Linux but need the
information visible to the user (cannot find my words) not the sytem
information (ex: a PC setup on greenwich but the date/time displayed are
relative to some other place.
Regards,
Philippe
--
http://mail.python.org/mailm
90 matches
Mail list logo