# Get File/Folder Date action failing in FB v7.0.0.1152

**URL:** https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354
**Category:** Bugs
**Created:** [April 19, 2011, 2:21am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354 "2011-04-19T02:21:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 19, 2011, 2:21am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/1 "2011-04-19T02:21:05Z")

</div>

Get File/Folder Date action failing in FB v7.0.0.1152.&nbsp; The script functioned fine in FB3.&nbsp; Here's the Build Log:

Error Executing script : OnGetDate  
Exception  
Could not convert value: string to TDateTime.  
Line: 4  
Char : 1  
OnGetDate script event failed.  
&nbsp;

The variable I'm using is a string.&nbsp; The help indicates it store as a formatted date/time string.

Jeff

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 19, 2011, 2:25am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/2 "2011-04-19T02:25:17Z")

</div>

Just some further info:   
  
 My File/Directory Name is: %sSourceDir%%sFileName%   
 Holding my mouse over it correctly equates it to: \ImageTest\Release\Globals\Dictionaries\american.adm.   
 That file exists.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 21, 2011, 7:36am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/3 "2011-04-21T07:36:09Z")

</div>

Hi Jeff   
  
 What do you have in your GetDate script event? without that info it’s difficult to figure out exactly what’s happening. We did find a problem with using DateTime Finalbuilder variables which we fixed by changing the format of the returned string, however I suspect you may be seeing a different issue. The build below may be worth trying :   
  
 [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1169.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1169.exe)

---

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [April 28, 2011, 11:40am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/4 "2011-04-28T11:40:00Z")

</div>

Hey Vincent,   
  
 1169 causes some of my existing Get Date actions to fail.   
  
 OnGetDate JavaScript:   
 Action.SendLogMessage("ModifiedDate Before: " + ModifiedDate);   
 var modDate = new Date(ModifiedDate);   
 ModifiedDate = modDate.format(“isoDateTime”);// 2007-06-09T17:46:21   
 Action.SendLogMessage(“ModifiedDate After: " + ModifiedDate);   
 eval(ActionProperties.ResultVariable + " = '” + ModifiedDate + “’;”);   
  
 Error:   
 Get Date [J:\views\masterbuild\1.0\UnitTests\FindFolder\TestData\1.2.3.0]   
 Status: Error   
 Date: 4/28/2011   
 Time: 14:36:33:841   
 End: 14:36:33:888   
 Duration: 00:00:00:047   
  
 Action Messages:   
 Checking if J:\views\masterbuild\1.0\UnitTests\FindFolder\TestData\1.2.3.0 exists…   
 Folder modified date: 2011-04-28 02:04:31   
 ModifiedDate Before: 2011-04-28 02:04:31   
 Error Executing script : OnGetDate   
 Microsoft JScript runtime error   
 Exception thrown and not caught   
 In Project Global Script, Line: 38   
 Char : 20   
 OnGetDate script event failed.

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [April 29, 2011, 5:38am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/5 "2011-04-29T05:38:28Z")

</div>

Hi Nelson   
  
 Is the format function something that you are calling in the Project Global script? If so could you please provide the code that is being called in the Project Global Script.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 29, 2011, 10:14am UTC](https://www.finalbuilder.com/forums/t/get-file-folder-date-action-failing-in-fb-v7-0-0-1152/3354/6 "2011-04-29T10:14:51Z")

</div>

Hi Nelson   
  
I was able to reproduce this here, assuming you are using the Javascript dateFormat extension from stevenlevithan.com? I have made some more changes to make it more backwards compatible with the old datetime format. Having said that, there is a way to achieve what you want in FB7 without resorting to scripting. Variables in FB7 can be either a variant (like in FB6 and earlier) or typed. Some variable types allow you to specify a format string, so if you specify your variable as a DateTime type and the format string as yyyy-mm-ddThh:nn:ss - then when the variable is used in a text field it will output the date in that format.   
  
https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1193.exe
