Page 1 of 1

{EncodedDate} only returning date

Posted: 16 Feb 2019, 14:22
by bdfrase
I'm trying to rename home videos my wife takes with her iDevices with creation timestamp data, like the default for Android. (eg. 20190418_142030.mp4). The .MOV files contain the data I need in EncodedDate (UTC timestamp). However, when I use the {EncodedDate} binding, it only returns the date portion.

I can't find "encodeddate" in the binding reference, and I only got this far by blunt force trial and error.

For help, I'd love to get a link to a solid binding reference or how to get the entire tag data for EncodedDate. I'm probably missing something fundamental about how Filebot accesses the tags in MediaInfo...

Image showing tag data.
Image

Image showing results of binding.
Image

Image showing error message
Image

Re: {EncodedDate} only returning date

Posted: 16 Feb 2019, 15:17
by rednoah
Please read this:
viewtopic.php?f=5&t=4285


You can access raw MediaInfo fields like so:

Code: Select all

{media.EncodedDate}
:idea: This will give you a String object, and not a Date object, so you can't do any date formatting.


FileBot does provider a convenience binding {encodedDate} which does give you a Date object, but with Year / Month / Day precision only, and without Hours / Minutes / Seconds information, which explains why HHmmdd doesn't work:

Code: Select all

{encodedDate}

You could take matters into your own hands and do something like this:

Code: Select all

{media.EncodedDate.parseDate('zzz yyyy-MM-dd HH:mm:ss').format('yyyyMMdd_HHmmdd')}
:!: Date.parseDate may require a newer FileBot 4.8.5 pre-release build.

Re: {EncodedDate} only returning date

Posted: 16 Feb 2019, 15:24
by bdfrase
Thank you!

Re: {EncodedDate} only returning date

Posted: 16 Feb 2019, 15:57
by bdfrase
For anyone with the same problem, this works in the current release:

Code: Select all

{media.EncodedDate.after("UTC ").replaceAll("-").colon("").space("_")}.{ext}