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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get time of file created 1

Status
Not open for further replies.

aspRookie1

Programmer
May 26, 2004
9
US
Hi,
I want to get the time of a file at which it was created.
I used the FileSystemObject's getDateCreated method to get the date of file.I gave me date and time as:
5/30/2004 1:17:55PM.
Now I just want time part of it.
It seems this is not a string object so it doesn't allow me to use any String functions on it.
The solution should be very easy somehow it is not clicking to my mind.
Thanks in advance
 
Hello aspRookie1,

It is apparently not that obvious indeed.
Code:
//let f be the file object already bound to
//fdt be the date-time object ready for manipulations
//tm is the time, in military hour format
var fdt = new Date(Date.parse(f.DateCreated));
tm = fdt.toString().split(" ")[3];
regards - tsuji
 
Thanks,
It seems this is what I wanted.
I will try and let you know.
Thanks Again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top