Properties, Dates and Zotero Integration

What I’m trying to do

When importing notes from Zotero, I am trying to have the properties date field automatically generated. I have added {{date}} to the template properties which is working in all other notes including my Daily Note.

When the same field is added to the Zotero template, it appears to be returning the Unix timestamp i.e. 1646744400000.

Things I have tried

Searched Zotero dates, Zotero properties, formatting date properties, Zotero integration and also templates without joy.

Also tried:
created date: moment().format(L);

as a value in the template, but returns the statement as a string.

1 Like

I am searching for an answer to precisely this problem. Just hoping that replying to you will prompt someone to find this and help!

1 Like

Success! I finally put the right search words into Discord and found the solution:

created: {% if dateAdded %}{{dateAdded | format(“YYYY-MM-DD”)}}{% endif %}
modified: {% if dateModified %}{{dateModified | format(“YYYY-MM-DD”)}}{% endif %}

This converts the Zotero output into the correct format!

1 Like

After a fair bit of trial and error, I finally got the date to display as follows in the Properties:

“created date:”: {{dateModified | format(“YYYY-MM-DD”)}}
“modified date:”:

Although the property is Created Date, the field for dateModified needs to be used as it is referring back to the Zotero dates. If you use dateAdded, it will return the date the article was added to Zotero. The format command returns the date in the format set in your system. For me in Australia, despite the format showing as YYYY-MM-DD, it returns the date as DD-MM-YYYY.

Happy I now have all my Zotero import properties working as I want them. Problem solved.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.