# How do I insert relative date/time in notes?

**URL:** <https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468>\
**Category:** Support\
**Created:** [10 August 2020 07:26 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468 "2020-08-10T07:26:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![O\_R](https://avatars.discourse-cdn.com/v4/letter/o/f1d935/32.png) [@O\_R](https://discourse.joplinapp.org/u/O_R)\
**Post date:** [10 August 2020 07:26 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/1 "2020-08-10T07:26:27Z")

</div>

I have a template that includes a custom span of dates. At this moment, in the body of the note all I can do is manually adjust it to the dates I need, but it would be nice to have Joplin do it for me.

More specifically, I want to have the first date be one day less than the current date and the last date, 7 days earlier. This is the template date format I am using now. It is the first line of the template:

Weekly review {{#custom\_datetime}}Y.MM.DD-1{{/custom\_datetime}} - {{#custom\_datetime}}Y.MM.DD-7{{/custom\_datetime}}

At this moment, the above template creates the relative date for the Name of note, but not in the body of the note:  
Note name: Weekly review 2020.08.09 - 2020.08.03  
Note body: Weekly review 2020.08.10-1 - 2020.08.10-7

---

<div class="post-metadata">

**Author:** ![franzperdido](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/franzperdido/32/2980_2.png) [@franzperdido](https://discourse.joplinapp.org/u/franzperdido)\
**Post date:** [20 July 2024 11:56 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/2 "2024-07-20T11:56:41Z")

</div>

I know this is kind of an old thread, but is this possible in Joplin? I've also played around with it but didn't get far. Ideally, I would like to combine this with a search s.t. I can get all open ToDos with a due date that is 7 days from the current day.

---

<div class="post-metadata">

**Author:** ![hieuthi](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/hieuthi/32/10815_2.png) [@hieuthi](https://discourse.joplinapp.org/u/hieuthi)\
**Post date:** [20 July 2024 13:46 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/3 "2024-07-20T13:46:17Z")

</div>

It's possible to type relative date using [Slash Command Plugin](https://discourse.joplinapp.org/t/plugin-slash-commands-datetime-more/22573)

Just type `/date-1` to get yesterday and `/date-7` for 7 days earlier.

I don't know about the search with relative data though

---

<div class="post-metadata">

**Author:** ![shikuz](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/shikuz/32/21839_2.png) [@shikuz](https://discourse.joplinapp.org/u/shikuz)\
**Post date:** [20 July 2024 14:08 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/4 "2024-07-20T14:08:19Z")

</div>

For searching relative dates, you may use the plugin [Inline Tag Navigator](https://discourse.joplinapp.org/t/plugin-inline-tag-navigator-v1-1-0-2024-07-20/35726). For example, a search for the range `#today -> #today+7` would return all tagged lines with dates matching the coming week (e.g., any line where `#2024-07-28` appears).

---

<div class="post-metadata">

**Author:** ![JackGruber](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jackgruber/32/3231_2.png) [@JackGruber](https://discourse.joplinapp.org/u/JackGruber)\
**Post date:** [20 July 2024 14:25 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/5 "2024-07-20T14:25:35Z")

</div>

With search filter it is possible: `due:day+7 iscompleted:0`

> **[Searching | Joplin](https://joplinapp.org/help/apps/search/)**
>
> Joplin implements the SQLite Full Text Search (FTS4) extension. It means the content of all the notes is indexed in real time and search queries return results very fast. Both Simple FTS Queries an...

---

<div class="post-metadata">

**Author:** ![muzak](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@muzak](https://discourse.joplinapp.org/u/muzak)\
**Post date:** [20 July 2024 14:43 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/6 "2024-07-20T14:43:34Z")

</div>

You can automatically get all open todos due 7 days from today by installing the [Note Overview plugin](https://joplinapp.org/plugins/plugin/io.github.jackgruber.note-overview/), then adding this content into a note:

```auto
<!-- note-overview-plugin
search: -due:day+8 iscompleted:0
fields: todo_due, title
alias: todo_due as Due Date, title as Todo
sort: todo_due ASC
-->

```

The above content generates and regularly updates a table of todos and due dates below it.

@JackGruber That should be `-due:day+8` since `due:day` (or `due:day+0`) returns nothing and `-due:day+1` returns todos due today.

---

<div class="post-metadata">

**Author:** ![franzperdido](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/franzperdido/32/2980_2.png) [@franzperdido](https://discourse.joplinapp.org/u/franzperdido)\
**Post date:** [21 July 2024 09:20 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/7 "2024-07-21T09:20:08Z")

</div>

Thanks for your reply!

But is it also possible to search relative to a specific date (instead of `today`)? I want to add the search query to my daily journal template, and search open todos relative to the date it was created. This date should then not be updated when updating the note overview on another day.

The following does not work:

```auto
due:2024-07-21+7 iscompleted:0

```

I did some more research and an alternative would be to put the time offset into the template itself.

> <https://github.com/joplin/plugin-templates/issues/61>
>
> A nice addition would be to be able to support a time offset. e.g. I want the ti…me to be offset 72 hrs forward so if on Friday I create a note with \`{{#custom\_datetime}}GGGG-\[W\]WW{{/custom\_datetime}}\` it will use \`WW\` for next week but if I created the note on Monday it would use \`WW\` for the current week.
> 
> This solution would also solve #53 in a more general way.

Apparently this is supported on the `master` branch but there hasn't been a release since. So maybe I will try to build the plugin locally and report back whether this works.

**Edit:** Can't get the plugin to build, but I'm also not experienced with web development. But could someone comment on what's blocking a release of the template plugin?

---

<div class="post-metadata">

**Author:** ![kaumpail](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/kaumpail/32/1577_2.png) [@kaumpail](https://discourse.joplinapp.org/u/kaumpail)\
**Post date:** [29 July 2024 06:19 UTC](https://discourse.joplinapp.org/t/how-do-i-insert-relative-date-time-in-notes/10468/8 "2024-07-29T06:19:05Z")

</div>

I was already quite annoying...

> <https://github.com/joplin/plugin-templates/pull/79>
>
> Fixes #56, #64

Looks like the devs don't have time/a new release doesn't have a high priority on their ToDo list
