This sure was tricky business, but it's working. Thanks to all who
participated.
Now if I can my "tutor" posting problem squared away!
Kent Johnson wrote:
On Sun, Sep 7, 2008 at 11:27 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
Well, maybe. Here's the file the change and result
On Sun, Sep 7, 2008 at 11:27 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> Well, maybe. Here's the file the change and results:
>
> # Using datetime to do date-time math on a file date-time stamp and
> # the creating the new stamp
> from datetime import datetime, timedelta
>
> Traceback (most recen
Title: Signature.html
Well, maybe. Here's the file the change and results:
# Using datetime to do date-time math on a file date-time
stamp and
# the creating the new stamp
from datetime import datetime, timedelta
format = '%Y%m%d_%H%M%S'
#d=datetime.strptime('20080321_113405', format)
d = da
2008/9/8 Wayne Watson <[EMAIL PROTECTED]>:
> I'm sure you have the essence below, but I'm not familiar with the In/ Out
> notation. Apparently, I need to scoop up the In lines into a file and add
> some print stmts for the In[x] d lines.
Kent uses IPython, which is an enhanced version of the stand
Title: Signature.html
Yep, I tried strptime and strftime but got stuck too often on something
or other (mostly mixing time, datetime somehow), so simplified matters
to make it clear what I was trying to do.
I'm sure you have the essence below, but I'm not familiar with the In/
Out notation. Ap
On Sun, Sep 7, 2008 at 9:33 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> Here's as far as I can go with this. The last line of output asks the
> question I need an answer for.
> (Once again my direct post to tutor@python.org has failed to appear here
> (sent 5:42 PDT), as before.)
It arrived late
2008/9/8 Wayne Watson <[EMAIL PROTECTED]>:
> def adjust_ftime(atime, sec):
> # mmdd_hhmmss, seconds in, new mmdd_hhmmss out
> ts = atime[1:-7] # use time stamp portion
> ayear = int(ts[0:4])
> amonth = int(ts[4:6])
> aday= int(ts[6:8])
> ahour = int(ts[
Title: Signature.html
Here's as far as I can go with this. The last line of output asks the
question I need an answer for.
(Once again my direct post to tutor@python.org has failed to appear
here (sent 5:42 PDT), as before.)
# Using datetime to do date-time math on a file date-time
stamp and
#
Title: Signature.html
Yes, my posting has become rather odd in that I don't see my own posts,
except for the first one. It seems to have started about a week ago.
I asked the owner about that and haven't gotten a reply yet. I hit
Reply, Reply to Sender or Reply to All on this message, I only s
On Sun, Sep 7, 2008 at 1:36 PM, Wayne Watson
<[EMAIL PROTECTED]>wrote:
> Yes, cut and paste directly from the code. Positively a import as seen.
> Here's the full set of code:
>
> # The effect of adding seconds to date-time to see if day gets changed
> import datetime
> dt1 = datetime.datetime(20
On Sun, Sep 7, 2008 at 1:17 PM, greg whittier <[EMAIL PROTECTED]> wrote:
>> # program to test str... functions
>> import datetime
>
> Are you sure you didn't do "from datetime import datetime"?
or "import time" ?
>> ...
>> # format conversion of date+time
>> dt1 = datetime.strptime("20080421_101
Is this an actual cut and paste of your code? The problem seems to be that
you're getting a time.struct_time object instead of a datetime object. See
below
On Sun, Sep 7, 2008 at 12:52 PM, Wayne Watson
<[EMAIL PROTECTED]>wrote:
> Yes, that's correct., but that reference isn't doing it for me p
I'm not clear on exactly what you're looking to do, but I think you want the
strftime and strptime methods. See
http://docs.python.org/lib/datetime-datetime.html
On Sun, Sep 7, 2008 at 11:24 AM, Wayne Watson
<[EMAIL PROTECTED]>wrote:
> I've been writing various functions with datetime to change
Title: Signature.html
I've been writing various functions with datetime to change date-time
formats from one to another. For example, my file names have a time
stamp of mmdd_hhmmss in their names. When I need to convert, say,
time by adding seconds to the hhmmss part of the file name, I hav
14 matches
Mail list logo