I want to creat file with each line having date + time + data so I can append more data as need be and know when it was added. What date+time function would be best?
bumsfeld
413
Nearly a Posting Virtuoso
Recommended Answers
Jump to PostI just was messing around with the time module tonight. are you asking for something simple like
>>> import time >>> time.ctime() 'Mon Oct 24 23:30:47 2005'
Jump to Posthow about this
import time # time.localtime() splits the time into elements of a tuple tuple_time = time.localtime() # don't europeans do day/month/year ? time_stamp = "%s:%s %s/%s/%s" %(tuple_time[3], tuple_time[4], tuple_time[2], tuple_time[1], tuple_time[0]) print time_stamp
edit added later//
I noticed a time like one minute after …
All 5 Replies
shanenin
0
Posting Whiz in Training
bumsfeld
413
Nearly a Posting Virtuoso
shanenin
0
Posting Whiz in Training
shanenin
0
Posting Whiz in Training
bumsfeld
413
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.