Dataview date column formatting not working

Hello everyone, tried my best to solve this on my own, but I don’t know why it is not working out.

What I’m trying to do

I’m trying to display a table containing a date column with format respecting the settings in Dataview.
Unfortunately, it is not being formatted.

This is my query:

TABLE created, modified, tags
WHERE modified >= "2024-03-14 15:27"

Things I have tried

I tried using a dateformat function without success. Any ideas what could be the cause?

Thank you!

Screenshot 2024-03-14 at 15.43.45
Screenshot 2024-03-14 at 15.43.28

Currently your text string is not recognised as a date, since it’s lacking the T between the date and time part. See date type

So basically you’ve got two options:

  1. Change all of your properties to become proper dates, and not just text strings as they are currently
  2. Use the date(text, format) to transform those texts into a date again, i.e. something like date(modified, "yyyy-MM-dd HH:mm") (Untested, but I think it’s the correct variant, as this is not the first time I’ve answered this question… )

What is odd is that the fields were already set as datetime:

In any case, your second suggestion worked like a charm.

TABLE date(created, "yyyy-MM-dd HH:mm") as "date"

Cheers!

What Obsidian considers a date, and what Dataview considers a date is unfortunately currently not the same. Obsidian accepts the missing T, but dataview doesn’t (as of v0.5.65). Therefore one needs to reformat it back into a date using that date(text, format) variant.

1 Like

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