Bases Don't Filter by file.ctime and file.mtime dates (using the simple filter builder)

Steps to reproduce

  1. Create a new bases table.
  2. Add a filter for the view "file.ctime > “2008-01-01”

Did you follow the troubleshooting guide? [Y/N]

Yes

Expected result

The table should list all the notes with the created date after 2008-01-01

Actual result

No results are shown the table

Environment

SYSTEM INFO:
Obsidian version: v1.9.2
Installer version: v1.5.12
Operating system: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 24.5.0
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

I have tried file.ctime and file.mtime and both show no results, despite the created and modified times for the files being after 01-01-2008.

The only filter that works for these properties are “is empty” or “is not empty”.

I found a similar post which suggested using the dateOnOrAfter() function, but Obsidian gives me the error “Failed to evaluate a filter: Cannot find function dataOnOrAfter”.

The base file:

filters:
  and:
    - file.folder == "Journal"
views:
  - type: table
    name: All
    filters:
      and:
        - file.ctime >= "2008-01-01"
    order:
      - file.name
      - tags
      - created
    columnSize:
      file.name: 422
      note.tags: 155
      note.created: 123
    sort:
      - column: note.created
        direction: DESC

Oh, I also tried created >= "2008-01-01", with the same results.

Examples

With the date filter, I get no results:

Remove the date filter, and the notes show up:

1 Like

Some further investigation…

Creating a filter date(file.ctime).year == 2008 seems to work.

file.ctime >= date("2008-01-01") should also be fine.


There should be a way to do this using the simple filter builder though.

Ah, yes. Thanks. That indeed works too.

I should have clarified actually - I was using the simple filter initially, but started to fiddle in the advanced mode afterwards. Either way, you’re right; it should work regardless.

1 Like

I played around a bit more trying to get files created on, on/after, etc., a certain date to work using only the simple filter builder, but couldn’t get it.

I’ll add that to the topic title for clarity.

1 Like

I thought this would be a good place to put the workarounds for each type of date comparison, as they also describe the bug for each type.

The issue seems to be that the simple filter builder doesn’t determine whether .date() or date(...) is needed thus doesn’t write them in.

So to overcome “failed to evaluate” warnings and get expected results when using the simple filter to…


… compare a datetime to a date string:

simple filter workaround
on, not on append .date() to the date
before, after, on or before, on or after wrap the date string in date()


… compare a date to a date string:

simple filter workaround
on, not on works as expected
before, after, on or before, on or after wrap the date string in date()


Examples of the types:

  • datetime
    • file.mtime
  • date
    • file.mtime.date()
    • date(this.file.name) on a daily note named “2025-01-01”
    • a custom date property named dateBegun
  • date string
    • “2025-01-01”
    • this.file.name on a daily note named “2025-01-01”