Page 1 of 1

Win10 Version - Date.Parse broken

Posted: 19 Aug 2018, 01:14
by longski96
Recently I reinstalled Win10 and bought the FileBot version from the Windows store, primarily due to its awesome Photo/Video renaming ability (I really think this should not be hidden anymore).

Initially this worked great. Then, all of a sudden Date.Parse has stopped working, breaking most of my scripts.

E.g.

Script subset:

Code: Select all

{Date.parse('dd-MM-yyyy', '19-08-2018')}
Error:

Code: Select all

Expression yields empty value: No signature of method: static java.util.Date.parse() is applicable for argument types: (String, String) values: [dd-MM-yyyy, 19-08-2018]
Possible solutions: parse(java.lang.String), wait(), clone(), grep(), any(), use(java.util.List, groovy.lang.Closure)
--

To me this looks like Date.parse(string one, sting two) is no longer in the Java API.

Filebot appears to be a Desktop Bridge app with an embedded version of Java, so I do not know why this would happen. Any ideas?

I've tried - reinstalling Filebot, deleting all AppData/ProgramData dirs, Installing full Java from the Web (not that this should be required), uninstalling it using Java's tool.

Re: Win10 Version - Date.Parse broken

Posted: 19 Aug 2018, 05:00
by rednoah
Looks like the Groovy runtime changed in a few strange places in backwards-incompatible ways... I'll fix this use case for the next version.

In the meanwhile, you can use this:

Code: Select all

new java.text.SimpleDateFormat('dd-MM-yyyy').parse('19-08-2018')

Re: Win10 Version - Date.Parse broken

Posted: 19 Aug 2018, 07:52
by longski96
Thanks, worked great for getting the real date from Timer videos:

Code: Select all

{new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").parse(media.comapplequicktimecreationdate)}

Re: Win10 Version - Date.Parse broken

Posted: 19 Aug 2018, 08:29
by rednoah
Do you mind sending me a sample file? I might be able to add some built-in bindings for this use case in future versions.