Keyboard shortcuts to enter current date/time

Keyboard shortcuts to enter the current date, current time, and current date/time combined

58 Likes

Should also support 24-hour clock or other formats. Maybe a setting that gives a default and uses some ISO standard format language to change it if you want.

Alfred for macOS uses this: http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns

4 Likes

I would argue that this would be for a plugin rather than core functionality.

I’m not arguing against its usefulness, though. I currently use a text expander for this purpose so I can do the same thing in other apps, too.

8 Likes

@death.au My one concern about this being a plugin and not in-app is that I’m hoping Obsidian has some consistency in how it handles date/time so plugins can rely on a consistent date/time format. Maybe @Licat can chime in.

6 Likes

@sam.baron has a good point. There are some preferences that maybe redundant such as time format preference.

I’d still think it goes with plugins, but maybe we can provide a centralized configuration that could be shared among plugins if necessary.

8 Likes

@sam.baron, @Licat Good points.

So potentially a plugin to insert dates via a keyboard shortcut, but the plugin should respect date format(s) set up in the app preferences :+1:
Would require the plugin interface to expose functions for getting the date format, and probably convenience functions to get preformatted dates.

6 Likes

It’d be cool if you could set the plugin to auto insert time/date (or any text) during custom conditions.

eg

  • end of a line after link break
  • each bullet in list (meeting minutes)
  • on format (like headers)
  • opening new note
2 Likes

Ideally one should be able to enter any date, using the same format set in the Daily Journal plugin settings.

2 Likes

Must have function I believe to access shortcut to a date picker or time by entering / like dynalist.

For now, I created a link to a batch file script that would copy the date to clipboard as a workaround. All you have to do is paste it to your notes.

The script is simple:
cmd /c date /t | clip

:slight_smile: enjoy

3 Likes

I’d love it if a date/time object could be part of obsidian’s core (although I understand this increases obisidan’s scope a bit).

My workflow around tasks is to link to the due dates and use the backlinks of a given day as an agenda of sorts. It’d be awesome if the daily notes plugin could leverage the backlinks and a date/time object to create a proper agenda!

3 Likes

I do exactly the same @death.au. I use Espanso on my Mac - lightweight and works well, with regular updates.

3 Likes

Was just coming to add a mention of espanso - https://espanso.org/

I’ve been creating templates for my daily entries, dates in my favorite format, etc.

4 Likes

I already have a autohotkey code running that allows me to generate time and date stamps with Alt+T, Alt+D respectively.
I use this in al of my note taking devices.

1 Like

I second this. I’m on Linux, and Autohotkey or similar functionality is outdated and/or missing on this platform.

If Plugin API would allow to setup new hotkeys there will be no problem to provide such a plugin, I believe. I saw what they even have MomentJS under the hood which gives more control over Date/Time.

1 Like

Check out espanso mentioned above… runs on Linux.

1 Like

Obsidian could take inspiration from the Discourse form for specifying a date/time (with the little calendar icon in the post editor). A benefit of this is that it’s machine-readable (and for the most part, human readable, especially when the WYSIWYG editor lands):

  • [date=2020-05-31 timezone="America/Los_Angeles"] -> 2020-05-31T07:00:00Z
  • [date=2020-06-01 time=17:00:00 timezone="America/Los_Angeles"] -> 2020-06-02T00:00:00Z
  • [date=2020-06-01 format="YYYY-MM-DD" timezone="America/Los_Angeles" timezones="UTC" recurring="1.weeks"] -> 2020-06-01

I don’t particularly care for the explicit timezone, but I can definitely see it’s value. It’d be extra awesome if Obsidian could parse something in the form - [ ] Important meeting [[date=2020-06-15 time=13:00:00]] and insert a link to the daily note for 2020-06-15. Extra brownie points if date/time objects can be inputted/displayed with natural language like Discourse does :grin:.

3 Likes

In the mean time, if you’re a windows user, here are my AutoHotKey scripts for text expanding dates. Change the shortcut to whatever works for you.

::ddtt::
FormatTime, Time, ,yyyy-MM-dd HH:mm
SendInput, %Time%
Return

::sddtt::
FormatTime, Time, ,yyyyMMdd_HHmm
SendInput, %Time%
Return

^!t::
::ddtts::
KeyWait Control, L  ; Wait for both Control and Alt to be released. (Required on Lenovo Yoga 14. Modifier keys would stay stuck and fuck shit up!)
KeyWait Alt, L
FormatTime, Time, ,yyyy-MM-dd HH:mm:ss
SendInput, %Time%
Return

::ddd::
FormatTime, Time, ,yyyy-MM-dd
SendInput, %Time%
Return

::dddd::
FormatTime, Time, ,yyyy-MM-dd dddd
SendInput, %Time%
Return

::sddd::
FormatTime, Time, ,yyyyMMdd
SendInput, %Time%
Return

::ttt::
FormatTime, Time, ,HH:mm:ss
SendInput, %Time%
Return

::ttm::
FormatTime, Time, ,HH:mm
SendInput, %Time%
Return
11 Likes

espanso is great. As a bonus you could create any keyboard shortcuts you wish. But yes it requires a little bit config work many end users might not be able to do. A default key for current date and current time + date as OneNote has might be needed.

4 Likes

Thank you. Just what the doctor ordered! :slight_smile:

1 Like