Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie - Correct modified date

Status
Not open for further replies.

Lozbinator

Programmer
Jan 13, 2003
50
AU
Hi,

I'm trying to get my script to correctly print the modified date of a file.

Rather than paste my rubbish code here, can anybody suggest what code to use?

I have managed to get it to print a time as a readable string, but its stuck on Tue Jan 01 00:00:00 1980 or 31/12/1979.

Thanks.
 
Thank you. I have tried that but the time that is displayed is not the same as the actual date modified on that field.

Any ideas?
 
Did you get the date/time with gmtime() or localtime() ?

Depending on your timezone (GMT+1, +2, etc.) these two methods will not return the same date/time.
(See gmtime() and localtime() in manual.)
 
I got sick of looking for what was wrong so I started the time thing again. Got it right now.

Thanks for the info, it helps.

On my third day of Pythong-ing, everything seems to be getting done that little bit faster. :)
 
Good :)
You'll see that with experience and some nice tricks work can be done very quickly.

lists, tuples, dictionnaries and slicing are your friends. Really.
 
Not to mention that assistance from people like yourself helps a lot - thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top