Re: i want to calculate how long since one file been modified. but i met some problem can u help me?? [message #66225] |
Wed, 29 April 2009 05:15 |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
stin.wang@gmail.com wrote:
> code as following
> IDL> ldf_info = file_info("d:\noaa_ldf")
> IDL> print,systime(0,ldf_info.mtime)
> Wed Apr 29 14:11:47 2009
> IDL> time_ldf = systime(1,ldf_info.mtime,/seconds)
> IDL> time_local = systime(1,/seconds)
> IDL> print,systime()
> Wed Apr 29 14:12:53 2009
> IDL> print,time_local-time_ldf
> 52.140000
> i was confused because i add a file in d:\noaa_ldf, then the time was
> Wed Apr 29 14:11:47 2009, so i convert it into seconds, so i can
> calculate time now by time when the directory was created. so
> it should be 66 seconds, but the idl shows 52.14, and 52+14=66, it's
> just a coincidence?? how to solve it??
it seems that file_info returns the time in seconds already...
try:
ldf_info = file_info("d:\noaa_ldf")
print, systime(1) - ldf_info.mtime ;in seconds
Jean
|
|
|