Standardize Originaldate

Tags: #<Tag:0x00007f4bf85147f8>

I’m noticing that many older albums only have a year in the originaldate field. Is there a script I can use to standardize the field in YYYY-MM-DD format? The script would need to fill in the blanks for any missing month or day fields.

What would you set as standard month or day if unknown? You could use a script like

$if($eq($len(%originaldate%),4),$set(originaldate,%originaldate%-01-01))

That would set January first.

3 Likes

Thank you! I looked up the functions and understand what you did. The only hiccup I see is when OriginalDate has year and month but no day. Maybe a second script?

$if($eq($len(%originaldate%),6),$set(originaldate,%originaldate%-01))

2 Likes

I’m thinking that should perhaps be:

$if($eq($len(%originaldate%),7),$set(originaldate,%originaldate%-01))
2 Likes

You’re right. I miscounted when I left out the dash in the date.