Dataview and date attribute: how do i show the date in a table?

Hi all! I’m an absolute noob to programming, but got a neat little table running after a few hours of studying + trial/error with the dataview plugin. It’s awesome :gift_heart:

Now one thing absolutely puzzles me.

My table looks like this. It’s simple. It works. I like it for now.

table status, verhaallijn, datum
from #verhaallijn/persoonlijk 

However. In the exact same table, I want to show the date on which these notes are created. How do I do that?

I played with the date-tag endlessly. My latest experiment was to put this as the metadata in the note:


titel: {{title}}
status: uglydraft
personages: desiree, helena
locatie: huishelena
verhaallijn: persoonlijk
datum: {{date}}

But that got me nowhere:

In the github reference for this plugin I saw the attribute file.ctime. That seems to be exactly what I need. But Google doesn’t cough up the noob user manual to use it properly and trial/error isn’t getting me where i want to be either…

Anyone here who can nudge me in the right direction? :blush:

Thanks in advance! D

You can use

table status, verhaallijn, datum, file.cday as "created"
from #verhaallijn/persoonlijk 

Instead of file.cday which returns the date a file was created on, you can also use file.ctime which returns the date and time instead.

For a more Dutch date format, you could even use:

table status, verhaallijn, datum, dateformat(file.cday, "dd-MM-yyyy") as "created"
from #verhaallijn/persoonlijk 

(just wanted to mention date formats, since the Dataview Docs are currently in maintenance; Luxon date format placeholders)

5 Likes

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