Title: Signature.html
What's the problem here. It seems right to me. line 9 is diff =...
import time
from datetime import datetime
def adjust_ftime(afilename, sec):
    # Vyyyymmdd_hhmmss+tag, seconds in, new yyyymmdd_hhmmss out
    ts = afilename[1:-7]      # use time stamp portion
    format = '%Y%m%d_%H%M%S'
    d = datetime(*(time.strptime(ts, format)[0:6]))
    print "sec: ", sec, type(d)
    diff = datetime.timedelta(seconds = sec)
    print type(diff)
    d = d + diff
    return d.strftime(format)

adjust_ftime('v20080120_000020.xx.dat',  33)

Results:
sec:  33 <type 'datetime.datetime'>
Traceback (most recent call last):
  File "C:/Sandia_Meteors/Improved_Sentinel/Sentinel_Playground/Utility_Dev/junk.py", line 14, in ?
    adjust_ftime('v20080120_000020.xx.dat', 33)
  File "C:/Sandia_Meteors/Improved_Sentinel/Sentinel_Playground/Utility_Dev/junk.py", line 9, in adjust_ftime
    diff = datetime.timedelta(seconds = sec)
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'

--
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet
            
            "Though no one can go back and make a brand new start, 
	     ANYONE can start from now and make a brand new end." 
		                    -- Anonymous
            
                    Web Page: <www.speckledwithstars.net/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to