# Get Timestamps ( Modified / Access Time ) for a Zip File

**URL:** https://www.finalbuilder.com/forums/t/get-timestamps-modified-access-time-for-a-zip-file/2321
**Category:** Discussion
**Created:** [November 7, 2014, 10:34am UTC](https://www.finalbuilder.com/forums/t/get-timestamps-modified-access-time-for-a-zip-file/2321 "2014-11-07T10:34:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mayurarora](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/ce7236/32.png) [@mayurarora](https://www.finalbuilder.com/forums/u/mayurarora)
#### Post date: [November 7, 2014, 10:34am UTC](https://www.finalbuilder.com/forums/t/get-timestamps-modified-access-time-for-a-zip-file/2321/1 "2014-11-07T10:34:03Z")

</div>

I’ve used this action Extract Zip File in my automise job.  
&nbsp;I need to check this execute condition under the run time tab : File Access Time - File Modified Time \>= 2 minutes.  
Is there a way to do this ( with VBscript or Javascript) ?

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [November 9, 2014, 11:41am UTC](https://www.finalbuilder.com/forums/t/get-timestamps-modified-access-time-for-a-zip-file/2321/2 "2014-11-09T11:41:04Z")

</div>

The following is javascript which will get the file access time and file modified time and see if there is more than 2 minutes difference. Remove the Math.Abs if you want to only know that access time is 2 minutes more than modified time.   
  
You can run the script in a script action and then save the result to a project variable. To do this you can use the following.   
  
FBVariables.MyVar = moreThanTwoMinutesDiff;

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [November 9, 2014, 11:44am UTC](https://www.finalbuilder.com/forums/t/get-timestamps-modified-access-time-for-a-zip-file/2321/3 "2014-11-09T11:44:57Z")

</div>

[code] var fs = new ActiveXObject("Scripting.FileSystemObject");var Filename = "C:\Temp\test.xml";if (FileExists(Filename)) { var f = fs.GetFile(Filename); if (f == null) { Action.SendLogMessage("Unable to open and check " + Filename, stError); return false; } var twoMinutes = 2000; Action.SendLogMessage("Last Accessed: " + f.DateLastAccessed); Action.SendLogMessage("Date Created: " + f.DateLastModified); var moreThanTwoMinutesDiff = Math.abs(f.DateLastModified - f.DateLastAccessed) \>= Math.abs(twoMinutes); if (moreThanTwoMinutesDiff) { Action.SendLogMessage("More than two minute diff " + Filename, stInformation); } else { Action.SendLogMessage("Less than two minute diff " + Filename, stInformation); }}else { Action.SendLogMessage("Could not locate file " + Filename, stError);}if (fs != null) { fs.Close;}[/code]
