On Fri, Apr 24, 2015 at 8:01 AM, Ian Kelly wrote:
> >>> dt.date(2014, 1, 1) + dt.timedelta(114 - 1)
> datetime.date(2014, 4, 24)
>
Thanks!
Vincent Davis
--
https://mail.python.org/mailman/listinfo/python-list
On Apr 24, 2015 7:45 AM, "Vincent Davis" wrote:
>
> How does one get the date given the day of a year.
>
> >>> dt.datetime.now().timetuple().tm_yday
>
> 114
>
> How would I get the Date of the 114 day of 2014?
You could use a timedelta:
>>> dt.date(2014, 1, 1) + dt.timedelta(114 - 1)
datetime.da
On 03/02/2015 11:25 AM, Chris Angelico wrote:
On Tue, Mar 3, 2015 at 3:09 AM, alister
wrote:
Sounds ominous. Is that better or worse than the final solution?
As in "this program will inadvertantly self distruct in five seconds"?
It's usually implied as being externally enforced, so I'd say
On 2015-03-02, greymausg wrote:
> On 2015-03-02, Steven D'Aprano wrote:
>> greymausg wrote:
>>
>>> I have a csv file, the first item on a line is the date in the format
>>> 2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
>>> replying "Expecting an integer". (I am really tryi
On 02/03/2015 15:42, Fabien wrote:
On 02.03.2015 15:26, Mark Lawrence wrote:
Have you tried Pandas? http://pandas.pydata.org/
If your csv file has no other problems, the following should do the
trick:
import pandas as pd
df = pd.read_csv('file.csv', index_col=0, parse_dates= {"time" : [0]})
On 02/03/2015 15:51, Chris Angelico wrote:
On Tue, Mar 3, 2015 at 2:24 AM, Mark Lawrence wrote:
On 02/03/2015 14:44, Steven D'Aprano wrote:
Mark Lawrence wrote:
Give me the Steven D'Aprano solution any day of
the week.
Sounds ominous. Is that better or worse than the final solution?
On Tue, Mar 3, 2015 at 3:09 AM, alister
wrote:
Sounds ominous. Is that better or worse than the final solution?
>>> As in "this program will inadvertantly self distruct in five seconds"?
>>
>> It's usually implied as being externally enforced, so I'd say it's more
>> akin to my solu
On Tue, 03 Mar 2015 02:51:28 +1100, Chris Angelico wrote:
> On Tue, Mar 3, 2015 at 2:24 AM, Mark Lawrence
> wrote:
>> On 02/03/2015 14:44, Steven D'Aprano wrote:
>>>
>>> Mark Lawrence wrote:
>>>
Give me the Steven D'Aprano solution any day of the week.
>>>
>>>
>>>
>>> Sounds ominous. Is that
On Tue, Mar 3, 2015 at 2:24 AM, Mark Lawrence wrote:
> On 02/03/2015 14:44, Steven D'Aprano wrote:
>>
>> Mark Lawrence wrote:
>>
>>> Give me the Steven D'Aprano solution any day of
>>> the week.
>>
>>
>>
>> Sounds ominous. Is that better or worse than the final solution?
>>
>
> As in "this program
On 02.03.2015 15:26, Mark Lawrence wrote:
Have you tried Pandas? http://pandas.pydata.org/
If your csv file has no other problems, the following should do the
trick:
import pandas as pd
df = pd.read_csv('file.csv', index_col=0, parse_dates= {"time" : [0]})
Cheers,
Fabien
IMHO complete ove
On 02/03/2015 14:44, Steven D'Aprano wrote:
Mark Lawrence wrote:
Give me the Steven D'Aprano solution any day of
the week.
Sounds ominous. Is that better or worse than the final solution?
As in "this program will inadvertantly self distruct in five seconds"?
--
My fellow Pythonistas, ask
On 02/03/2015 14:44, Steven D'Aprano wrote:
> Mark Lawrence wrote:
>
>> Give me the Steven D'Aprano solution any day of
>> the week.
>
>
> Sounds ominous. Is that better or worse than the final solution?
>
>
>
Well if you can have it on any day of the week it can't be *that* final?
TJG
--
On 2015-03-02, Steven D'Aprano wrote:
> greymausg wrote:
>
>> I have a csv file, the first item on a line is the date in the format
>> 2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
>> replying "Expecting an integer". (I am really trying to get the offset
>> in weeks from th
On 2015-03-02, Fabien wrote:
> On 02.03.2015 12:55, greymausg wrote:
>> I have a csv file, the first item on a line is the date in the format
>> 2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
>> replying "Expecting an integer". (I am really trying to get the offset
>> in wee
Mark Lawrence wrote:
> Give me the Steven D'Aprano solution any day of
> the week.
Sounds ominous. Is that better or worse than the final solution?
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On 02/03/2015 12:25, Fabien wrote:
On 02.03.2015 12:55, greymausg wrote:
I have a csv file, the first item on a line is the date in the format
2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
replying "Expecting an integer". (I am really trying to get the offset
in weeks fro
greymausg wrote:
> I have a csv file, the first item on a line is the date in the format
> 2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
> replying "Expecting an integer". (I am really trying to get the offset
> in weeks from that date to today())
What is "date"? Where doe
On 02.03.2015 12:55, greymausg wrote:
I have a csv file, the first item on a line is the date in the format
2015-03-02 I try to get that as a date by date(row[0]), but it barfs,
replying "Expecting an integer". (I am really trying to get the offset
in weeks from that date to today())
Have you t
Puruganti Ramesh wrote:
> I have an issue in comparing dates in python 2.7.8
No, you are stuck with parsing the dates, you don't get to the point of
comparing them.
> I am getting below excption
> Traceback (most recent call last):
> File "FunctionUpdate.py", line 204, in
> dt_dateb = datetime
On Fri, Feb 20, 2015 at 8:32 PM, Puruganti Ramesh
wrote:
> import datetime as dt
> from datetime import datetime
> from datetime import datetime, timedelta, date
The first two lines here are achieving nothing - the third should be
all you need.
> dt_str='2014-5-11'
> dt_strq='2014-9-11'
>
> dt_d
>
> >
>
> >
>
> http://docs.python.org/2/library/datetime
>
> """ An object of type *time* or *datetime* may be naive or *aware"
>
>
>
> aware refers to time-zone and daylight savings time, such political
>
> ephemerals. Two times can only be changed if one knows they're both in
>
> the
On 12/10/2012 03:52 PM, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>> I want to compare a user entered date-and-time against the date-and-time
>> of a pdf file. I posted on this (how to get a file's date-time) before,
>> was advised to do it like:
>>
>> import date
On Monday, December 10, 2012 3:52:55 PM UTC-5, Steven D'Aprano wrote:
> On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
>
>
>
> > I want to compare a user entered date-and-time against the date-and-time
>
> > of a pdf file. I posted on this (how to get a file's date-time) before,
>
> > was a
On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote:
> I want to compare a user entered date-and-time against the date-and-time
> of a pdf file. I posted on this (how to get a file's date-time) before,
> was advised to do it like:
>
> import datetime, os, stat
> mtime = os.lstat(filename)[stat.ST_MT
Found this, and it solved my problem
http://blogs.law.harvard.edu/rprasad/2011/09/21/python-string-to-a-datetime-object/
--
http://mail.python.org/mailman/listinfo/python-list
In <21eb3e6f-9a82-47aa-93ff-8f4083d18...@googlegroups.com> noydb
writes:
> I want to compare a user entered date-and-time against the date-and-time of
> a pdf file. I posted on this (how to get a file's date-time) before, was
> advised to do it like:
> import datetime, os, stat
> mtime = os.ls
On Mon, 2012-10-29 at 16:13 -0700, noydb wrote:
> All,
> I need help with a date and time comparison.
> Say a user enters a date-n-time and a file on disk. I want to compare
> the date and time of the file to the entered date-n-time; if the file
> is newer than the entered date-n-time, add the fil
Gary Herron wrote:
> On 10/29/2012 04:13 PM, noydb wrote:
> > All,
> >
> > I need help with a date and time comparison.
> >
> > Say a user enters a date-n-time and a file on disk. I want to compare the
> > date and time of the file to the
> entered date-n-time; if the file is newer than the enter
On 10/30/2012 12:20 AM, noydb wrote:
> On Monday, October 29, 2012 11:11:55 PM UTC-4, Dave Angel wrote:
>> On 10/29/2012 10:13 PM, noydb wrote:
>>
>>> I guess I get there eventually!
>>
>>>
>>
>>
>
> okay, I see.
> But for the user supplied date... I'm not sure of the format just yet...
> test
On Tue, Oct 30, 2012 at 3:20 PM, noydb wrote:
> But for the user supplied date... I'm not sure of the format just yet...
> testing with a string for now (actual date-date might be possible, tbd
> later), so like '10292012213000' (oct 29, 2012 9:30pm). How would you get
> that input into a form
On Monday, October 29, 2012 11:11:55 PM UTC-4, Dave Angel wrote:
> On 10/29/2012 10:13 PM, noydb wrote:
>
> > I guess I get there eventually!
>
> > This seems to work
>
> >
>
> > pdf_timeStamp =
> > time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf)))
>
> > intermedia
On 2012-10-30 03:11, Dave Angel wrote:
On 10/29/2012 10:13 PM, noydb wrote:
I guess I get there eventually!
This seems to work
pdf_timeStamp =
time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf)))
intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S")
pdfFile
On 10/29/2012 10:13 PM, noydb wrote:
> I guess I get there eventually!
> This seems to work
>
> pdf_timeStamp =
> time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf)))
> intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S")
> pdfFile_compareTime = time.mktime(
I guess I get there eventually!
This seems to work
pdf_timeStamp =
time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf)))
intermediateTime = time.strptime(pdf_timeStamp, "%m%d%y%H%M%S")
pdfFile_compareTime = time.mktime(intermediateTime)
(and I'll do the same to the us
if I do time.time() I get 1351562187.757, do it again I get 1351562212.2650001
--- so I can compare those, the latter is later then the former. Good. SO how
do I turn pdf_timeStamp (a string) above into time in this (as from
time.time()) format? Am I on the right track -- is that the way to d
Thanks, I did find this...
pdf_timeStamp =
time.strftime("%m%d%y%H%M%S",time.localtime(os.path.getmtime(pdf)))
>> pdf_timestamp
>> '102909133000'
... but now how to do the comparison? Cannot just do a raw string comparison,
gotta declare it a date
--
http://mail.python.org/mailman/listinfo/p
On 2012-10-30 00:04, Gary Herron wrote:
On 10/29/2012 04:13 PM, noydb wrote:
All,
I need help with a date and time comparison.
Say a user enters a date-n-time and a file on disk. I want to compare the date
and time of the file to the entered date-n-time; if the file is newer than the
entere
On 10/29/2012 04:13 PM, noydb wrote:
All,
I need help with a date and time comparison.
Say a user enters a date-n-time and a file on disk. I want to compare the date
and time of the file to the entered date-n-time; if the file is newer than the
entered date-n-time, add the file to a list to
Gavin writes:
> python-dateutil seems to work very well if everything is in English,
> however, it does not seem to work for other languages and the
> documentation does not seem to have any information about locale
> support.
Probably because I don't think there is much built in. You'll want t
On Thu, 22 Oct 2009 10:56:07 +
baboucarr sanneh wrote:
> > By the way, the convention on this list is to bottom-post,
>
> okay i got that will be doing so from now on :)thnx
Thanks but what the previous poster forgot to mention was that you
should also trim the text that you are replying
$LIM $...@dy
> Date: Thu, 22 Oct 2009 11:51:08 +0100
> From: m...@timgolden.me.uk
> CC: python-list@python.org
> Subject: Re: Date strftime('%d%m%y') date to be of yesterday
>
> baboucarr sanneh wrote:
> >
> > Hi tim
> >
> > Thank yo
baboucarr sanneh wrote:
Hi tim
Thank you very much ...I have got it now..now i can continue with the backup
script i want to make
By the way, the convention on this list is to bottom-post,
that is to add your comments / reply to the bottom of the
post you're replying to. These things vary
Hi tim
Thank you very much ...I have got it now..now i can continue with the backup
script i want to make
$LIM $...@dy
> Date: Thu, 22 Oct 2009 11:36:50 +0100
> From: m...@timgolden.me.uk
> CC: python-list@python.org
> Subject: Re: Date strftime('%d%m%y') d
baboucarr sanneh wrote:
Hi tim,
well i tried what your script but i do have an error
import datetime
yesterday = datetime.date.today () - datetime.timedelta (days=1)
print yesterday.strftime ("%d%m%y")
SyntaxError: invalid syntax (, line 1)
when i jus check the variable i.e yesterday i do ge
le i.e yesterday i do get the out put but its in a
different format
datetime.date(2009, 10, 21)
it seems like the conversion that is where the error is coming form
I want it to be like 211009
Thank you
$LIM $...@dy
> Date: Thu, 22 Oct 2009 11:14:46 +0100
> From: m...@timgolden.me.uk
baboucarr sanneh wrote:
Hi all
I want to output the date of the with this format strftime('%d%m%y') but the
date ie '%d' should be the date of yesterday
eg
import time
strftime('%d%m%y') # something like minus a day..
Thank you..am a newbie to python
import datetime
yesterday = datetime.d
flebber.c...@gmail.com wrote:
I don't think I am using re.compile properly, but thought as this
would make my output an object it would be better for later, is that
correct?
#Obtain date
def ObtainDate(date):
date = raw_input("Type Date dd/mm/year: ")
re.split('[/]+', date)
date
year = date[-1
I don't think I am using re.compile properly, but thought as this would
make my output an object it would be better for later, is that correct?
#Obtain date
def ObtainDate(date):
date = raw_input("Type Date dd/mm/year: ")
re.split('[/]+', date)
date
year = date[-1]
month = date[1]
day = date[0]
On Sep 24, 7:49 am, flebber wrote:
> On Sep 24, 11:10 pm, flebber wrote:
>
>
>
> > On Sep 24, 10:58 pm, Dave Angel wrote:
>
> > > flebber.c...@gmail.com wrote:
> > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > > > class or instructor, I am learning this myself. I ha
Okay, thanks for the advice that sounds a good place to start. I used %2.os
was an attempt to define width and precision to stop typo errors eg the
user accidentally inputing 101/09/2009 or similar error. So that the
__/__/ was adhered to.
I will go back to the start get the basics happ
flebber wrote:
On Sep 24, 11:10 pm, flebber wrote:
On Sep 24, 10:58 pm, Dave Angel wrote:
flebber.c...@gmail.com wrote:
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
class or instructor, I am learning this myself. I have Hetlands book
"Beginning Python
Surely getting it tottally mixed up
from datetime import date
def ObtainDate(params):
date = raw_input("Type Date dd/mm/year: %2.0r%2.0r/%2.0r%2.0r/%4.0r
%4.0r%4.0r%4.0r")
print date.datetime(year-month-day)
By setting "date = raw_input(...)", you mask the datetime.date
object preventing yo
On Sep 24, 11:10 pm, flebber wrote:
> On Sep 24, 10:58 pm, Dave Angel wrote:
>
>
>
> > flebber.c...@gmail.com wrote:
> > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > > class or instructor, I am learning this myself. I have Hetlands book
> > > "Beginning Python Novice
On Sep 24, 10:58 pm, Dave Angel wrote:
> flebber.c...@gmail.com wrote:
> > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > class or instructor, I am learning this myself. I have Hetlands book
> > "Beginning Python Novice to Professional and online documentation
> > books so
flebber.c...@gmail.com wrote:
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
class or instructor, I am learning this myself. I have Hetlands book
"Beginning Python Novice to Professional and online documentation
books so Dive into Python, python.org etc.
Using the SPE edi
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class
or instructor, I am learning this myself. I have Hetlands book "Beginning
Python Novice to Professional and online documentation books so Dive into
Python, python.org etc.
Using the SPE editor.
I have currently only
flebber wrote:
Sorry to ask a simple question but I am a little confused how to
combine the input function and the date time module.
Simply at the start of the program I want to prompt the user to enter
the date, desirably in the format dd/mm/year.
However I want to make sure that python underst
Bill McClain wrote:
On 2009-02-03, mohana2...@gmail.com wrote:
Hi,
I need to compare two dates and find the number of days between those
two dates.This can be done with datetime module in python as below,
but this is not supported in Jython.
There are julian day routines in this astronomy pa
mohana2...@gmail.com writes:
> I need to compare two dates and find the number of days between those
> two dates.This can be done with datetime module in python as below,
> but this is not supported in Jython.
>
> example
> from datetime import date
> a=datetime.date(2009,2,1)
> b=datetime.date(2
Simon Brunning wrote:
> 2009/2/3 Diez B. Roggisch :
>> Use the java API of java.util.
>
> Or better still, use Joda.
>
"dates compare you must?"
SCNR. Didn't know of this incarnation of him...
Diez
--
http://mail.python.org/mailman/listinfo/python-list
2009/2/3 Diez B. Roggisch :
> Use the java API of java.util.
Or better still, use Joda.
--
Cheers,
Simon B.
--
http://mail.python.org/mailman/listinfo/python-list
On 2009-02-03, mohana2...@gmail.com wrote:
> Hi,
> I need to compare two dates and find the number of days between those
> two dates.This can be done with datetime module in python as below,
> but this is not supported in Jython.
There are julian day routines in this astronomy package:
http
mohana2...@gmail.com wrote:
> Hi,
> I need to compare two dates and find the number of days between those
> two dates.This can be done with datetime module in python as below,
> but this is not supported in Jython.
>
> example
> from datetime import date
> a=datetime.date(2009,2,1)
> b=datetime.
On Thu, Jan 29, 2009 at 2:27 PM, M.-A. Lemburg wrote:
> On 2009-01-29 03:38, Gabriel Genellina wrote:
> > En Wed, 28 Jan 2009 18:55:21 -0200, S.Selvam Siva
> > escribió:
> >
> >> I need to parse rss-feeds based on time stamp,But rss-feeds follow
> >> different
> >> standards of date(IST,EST etc)
On 2009-01-29 03:38, Gabriel Genellina wrote:
> En Wed, 28 Jan 2009 18:55:21 -0200, S.Selvam Siva
> escribió:
>
>> I need to parse rss-feeds based on time stamp,But rss-feeds follow
>> different
>> standards of date(IST,EST etc).
>> I dont know,how to standardize this standards.It will be helpful
En Wed, 28 Jan 2009 18:55:21 -0200, S.Selvam Siva
escribió:
I need to parse rss-feeds based on time stamp,But rss-feeds follow
different
standards of date(IST,EST etc).
I dont know,how to standardize this standards.It will be helpful if you
can
hint me.
You may find the Olson timezone
Ahmed, Shakir wrote:
I am grabbing few fields from a table and one of the columns is in date
format. The output which I am getting is "Wed Feb 09 00:00:00 2005" but
the data in that column is "02/09/2005" and I need the same format
output to insert those recodes into another table.
print my_serv
The author has updated the Tutorial and added a flex method.
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
What I'm trying to do is adjust date-time stamped file names for date and
time errors. The software program collects through a period that roughly
coincides with night hours every day and according to the OS clock.
W. eWatson wrote:
John Machin wrote:
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
What I'm trying to do is adjust date-time stamped file names for date
and
time errors. The software program collects through a period that roughly
coincides with night hours every day and accordi
John Machin wrote:
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
What I'm trying to do is adjust date-time stamped file names for date and
time errors. The software program collects through a period that roughly
coincides with night hours every day and according to the OS clock.
John Machin wrote:
>On Aug 30, 10:41 am, "W. eWatson" wrote:
>
>> What I'm trying to do is adjust date-time stamped file names for date and
>> time errors. The software program collects through a period that roughly
>> coincides with night hours every day and according to the OS clock. It
>> so
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> What I'm trying to do is adjust date-time stamped file names for date and
> time errors. The software program collects through a period that roughly
> coincides with night hours every day and according to the OS clock. It
> sometimes h
John Machin wrote:
On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
I just tried the following code, and got an unexpected result.
from pyfdate import *
t = Time()
ts = Time(2008, 8, 29,15,20,7)
tnew = ts.plus(months=6)
print "new date: ", tnew
Result:
new date: 2009-02-28 15:20:0
On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> I just tried the following code, and got an unexpected result.
>
> from pyfdate import *
> t = Time()
>
> ts = Time(2008, 8, 29,15,20,7)
> tnew = ts.plus(months=6)
> print "new date: ", tnew
>
> Result:
> new date: 2009-02-28 15:20:07
>
W. eWatson wrote:
I just tried the following code, and got an unexpected result.
from pyfdate import *
t = Time()
ts = Time(2008, 8, 29,15,20,7)
tnew = ts.plus(months=6)
print "new date: ", tnew
Result:
new date: 2009-02-28 15:20:07
I believe that should be April 1, 2009. If I use months = 1
I just tried the following code, and got an unexpected result.
from pyfdate import *
t = Time()
ts = Time(2008, 8, 29,15,20,7)
tnew = ts.plus(months=6)
print "new date: ", tnew
Result:
new date: 2009-02-28 15:20:07
I believe that should be April 1, 2009. If I use months = 1 and day =31, I
ge
En Tue, 26 Aug 2008 08:53:40 -0300, Haeyoung Kim <[EMAIL PROTECTED]>
escribi�:
I'm migrating a VBScript into python.
How should I convert Date type parameter in VBScript's COM interface
with win32com?
Look for PyTime in the pywin32 documentation.
--
Gabriel Genellina
--
http://mail.pytho
John Machin wrote:
On Aug 27, 11:24 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
John Machin wrote:
On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
I'm using IDLE for Python 2.4, and put pfydate distribution in
C:\Python24\Lib\site-packages\pfydate, as required by the
page.
How to
Haeyoung Kim wrote:
Hi.
I'm migrating a VBScript into python.
How should I convert Date type parameter in VBScript's COM interface
with win32com?
I couldn't find any answer yet...
Could you give an example of code you're trying
to translate? Normally it's quite simple, but
different subsyste
On Aug 27, 11:24 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> John Machin wrote:
> > On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> >> I'm using IDLE for Python 2.4, and put pfydate distribution in
> >> C:\Python24\Lib\site-packages\pfydate, as required by the
> >> page.
> >> How
On Tue, Aug 26, 2008 at 9:24 PM, W. eWatson <[EMAIL PROTECTED]> wrote:
> John Machin wrote:
>
>> On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
>>
>>> I'm using IDLE for Python 2.4, and put pfydate distribution in
>>> C:\Python24\Lib\site-packages\pfydate, as required by the
>>> pag
John Machin wrote:
On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
I'm using IDLE for Python 2.4, and put pfydate distribution in
C:\Python24\Lib\site-packages\pfydate, as required by the
page.
How to install pyfdate.
Save pyfdate.py into your PythonNN/Lib/site-packages direc
On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
>
> I'm using IDLE for Python 2.4, and put pfydate distribution in
> C:\Python24\Lib\site-packages\pfydate, as required by the
> page.
> How to install pyfdate.
>
> Save pyfdate.py into your PythonNN/Lib/site-packages directory.
> I
[EMAIL PROTECTED] wrote:
check out Pyfdate: http://www.ferg.org/pyfdate
from pyfdate import *
t = Time().add(hours=14)
print "It is now", t.wdt
datestring1 = "2005/10/05" #year,month,day
datestring2 = "2002/09/22" #year,month,day
datestring3 = "2007/11/11" #year,month,day
year,month,day = num
[EMAIL PROTECTED] wrote:
check out Pyfdate: http://www.ferg.org/pyfdate
from pyfdate import *
t = Time().add(hours=14)
print "It is now", t.wdt
datestring1 = "2005/10/05" #year,month,day
datestring2 = "2002/09/22" #year,month,day
datestring3 = "2007/11/11" #year,month,day
year,month,day = num
check out Pyfdate: http://www.ferg.org/pyfdate
from pyfdate import *
t = Time().add(hours=14)
print "It is now", t.wdt
datestring1 = "2005/10/05" #year,month,day
datestring2 = "2002/09/22" #year,month,day
datestring3 = "2007/11/11" #year,month,day
year,month,day = numsplit(datestring1) # split
"W. eWatson" <[EMAIL PROTECTED]> writes:
> Are there some date and time comparison functions that would compare, say,
>
> Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd)
> Is 02/11/07 the same as 02/11/07?
>
> Is 14:05:18 after 22:02:51? (24 hour day is fine)
>
> How about the dat
In <[EMAIL PROTECTED]>, Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>In <[EMAIL PROTECTED]>,
>>rsutradhar_python wrote:
>>> date1="2006-01-10"
>>> date2="2005-12-15"
>>> date = date1 - date2
>>> should give me 25 but problem is tha
In article <[EMAIL PROTECTED]>,
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>In <[EMAIL PROTECTED]>,
>rsutradhar_python wrote:
>
>> How to subtract date which is stored in string variable?
>>
>> Example:
>>
>> date1="2006-01-10"
>> date2="2005-12-15"
>> date = date1 - date2
>> should giv
In <[EMAIL PROTECTED]>,
rsutradhar_python wrote:
> How to subtract date which is stored in string variable?
>
> Example:
>
> date1="2006-01-10"
> date2="2005-12-15"
> date = date1 - date2
> should give me 25 but problem is that date1 and date2 datatype is
> string which need to be conerted into
Bell, Kevin wrote:
> Anyone aware of existing code to turn a date string "8-15-05" into the
> number 20050815?
>>> import datetime
>>> s = "8-15-05"
>>> month,day,year = map(int, s.split('-'))
>>> date = datetime.date(2000+year,month,day)
>>> date.strftime('%Y%m%d')
'20050815'
Of course, if
setup.py install
--
http://mail.python.org/mailman/listinfo/python-list
There's more than one way, but this one will work for
dates prior to 2000.
import time
datestring='8-15-05'
d=time.strptime(datestring,'%m-%d-%y')
number=1*d[0]+100*d[1]+d[2]
print number
-Larry Bates
Bell, Kevin wrote:
> Anyone aware of existing code to turn a date string "8-15-05" into the
"Bell, Kevin" wrote:
> Anyone aware of existing code to turn a date string "8-15-05" into the
> number 20050815?
date = "8-15-05"
import re
m, d, y = map(int, re.match("(\d+)-(\d+)-(\d+)$", date).groups())
number = 2000 + y*1 + m*100 + d
print number
--
http://mail.python.org/mai
Tim Williams (gmail) wrote:
> Using zipfile.Zipfile
>
> How can I add a file to a zip file and keep its date and time correct?
> Currently the date/time change to the time the file was added to the
> zip.Zipinfo doesn't have a write method!
>
> Solutions other than zipfile are welcome, with
When I add files to my .ZIP files using python zipfile module
the date/time that is stored in mine is the one that comes from
the file's attributes. I'm not sure I understand why you think
yours are not.
-Larry Bates
Tim Williams (gmail) wrote:
> Using zipfile.Zipfile
>
> How can I add a file
Maksim Kasimov wrote:
> there are few of a time periods, for example:
> 2005-06-08 12:30 -> 2005-06-10 15:30,
> 2005-06-12 12:30 -> 2005-06-14 15:30
>
> and there is some date and time value:
> 2005-06-11 12:30
> what is the "pythonic" way to check is the date/time value in th
Maksim Kasimov wrote:
> what is the "pythonic" way to check is the date/time value in the given
> periods range?
Something like this, though I won't make strong claims of
"pythonicness". If you want to use the "in" keyword you'll want a
custom class and overriding of __contains__.
import time
"Sara Khalatbari" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> Is there a program in python that inputs a date & a
> time, for example: "2005-04-17 04:20+". And
> returns a digit, for example: "3501" instead?
>
> and if there is such program or built-in function, how
1 - 100 of 114 matches
Mail list logo