Need help with correct date and time variables in a template

Hello all,
I did look and search in the forum. I did find several entries related to the use of date and time variables in an Obsidian template (without using a special plugin!). And I have a setting that I do use in my “german” Obsidian. The result looks fine, though I still do get the hint that things seem not to comply to the rules…

Can someone please explain? What am I doing wrong?
Thanks, Wolfgang

1 Like

I have a few templates with the same “problem” …

image

… but, you also mentioned, as the results look fine and the note is working, I stopped worrying about it.

Following the post to see if there will be an explanation or solution … “solution”, as it is only a visual problem and not functional. I guess.

Cheers, Marko :nerd_face:

Don’t bother viewing or editing templates with the Properties UI. It will give you a headache.

Switch to source mode for a pleasant day.


For Templater templates, you can use this:

1 Like

Is a three-token year valid?

I use ISO 8601 dates (yyyy-mm-ddThh:mm:ss) throughout my vault. Wish I had known about using ISO 8601 when I first started using Obsidian. I use it today throughout my Mac when naming files because of the immediate structure it provides.

There are two vital aspects you need to be aware of when doing this template:

  1. You’re dictating what is actually written within your note, NOT what is displayed afterwards
  2. Using a non ISO8601 format will in most case cause querying against that date field to fail

So as @Guapa eludes to, you’re far better of using ISO 8601 date format in your source files, as the written information, that is something like the {{date:yyyy-mm-ddThh:mm:ss}}. This will allow Obsidian to properly treat it as a date field, remove the warning sign, and the locale information on your desktop should present it according to what’s normal for your country.

Secondly, by using ISO 8601 most plugins related to handling properties, and especially Dataview, will accept this property as a date from the start without the need to somehow convert it before you can use it in your queries.

Lastly, do remember that the ISO 8601 is chronological sorted when alphanumeric sorted, so it’s very useful with that respect. That is you can sort the property as text, and it’s sorted according to time as well. That is not true for any format shifting days in front of the months (dd-MM) (or month in front of the days (MM-dd ) in front of the year (-yyyy).

3 Likes

:wink: Thanks!!
Good to know, Wolfgang