Is creation time (like file.ctime) possible for inline values?

Is it at all possible to associate ctime with an inline value in dataview?

I would like be able to do something like

key1:: value1, created at 2022-23-12-22-33-44
key1:: value2, created at 2022-23-12-23-44-01

I searched for it but didn’t find a discussion that went already in this direction.

What I want to do is something of a daily log that I than can query to weekly, monthly or yearly overviews.

I see two ways: via inlines fields or with bullet point lists.

I leave here the content of one note to basic test purposes (copy the content to a new note and explore:

## with inline fields

key1:: value1 | 2022-12-23T22:33:44
key1:: value2 | 2022-12-23T23:44:01

WHERE file.path = this.file.path
FLATTEN split(K, " \| ")[0] AS Kv
FLATTEN date(split(K, " \| ")[1]) AS Kt

## with bullet point list
- value1 (time:: 2022-12-23T22:33:44)
- value2 (time:: 2022-12-23T22:33:44)
- a false list item to test my query

	regexreplace(L.text, "\(.*$", ""),
	dateformat(L.time, "yyyy-MM-dd HH:mm:ss")
WHERE file.path = this.file.path
FLATTEN file.lists AS L
WHERE L.time

Besides the metadata structure, if you’re not interested in use js, only regular queries, you need to use dates in a valid ISO format (read plugin docs).

(as a regex dumb, I’m not sure if the used expression is the right one)

1 Like

I think I can safely say, that the short answer is No, that’s not easily done.

The longer answer, is that you could possibly achieve something like that if you make a meticulous methodology for doing so. Like having all key1 fields, have an accompanying key1-ctime field. But updating such a system would be somewhat painful, unless you only update using some special tools (which you’ll need to define/implement yourself).

In the end, I would want to ask why do you need this, and what’s the purpose of it? If you really need to track changes on such a level, you might need some variant over the theme of source control (like git) with repetitious check-ins, and some elaborate system to detect when/what was changed.

An alternate way, which might accommodate your needs (which is not very detailed in its description), could be to let the daily log be more granular than each day. Would it be helpful if you used more like an hourly log? Then you would be able to use the ctime of the note, possibly, to get closer to your goal?

1 Like

Thank you. As always, your input is very helpful! Will give this a try!

The short answer to “why” is: Because I can.

The long answer: You are right, there are systems that may make more sense for this. But I am currently on a path where I would like to do as much as possible with Obsidian. And as to your suggestions with hourly notes: Yes, that also would make it easier, but would leave me with a ton of notes. The suggested solution by @mnvwvnm seems doable, specially since I plan to automate the entry of the notes with iOS Shortcuts and advanced URI.

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