Insert Date or Date/Time at insertion point

How are people inserting the date at the insertion point in iOS?

Generally speaking I use the Text Replacement feature of the keyboard for a couple of long strings (my email signature and the link to the mosaic program I use) but wondered what people do for a dynamic template.

I’d like to find a non subscription solution to the problem

You could use Shortcuts to put the date in the desired format on the clipboard, trigger it on iOS with an accessibility back tap (double/triple), and then paste in the result.


I’m not sure if you can reduce the two-step process any further for something dynamic.

But if you are using a specific app, then there may be other options. For example, you can have actions in many editors that allow you to insert things like the current date.

Hope that helps.

1 Like

Seems viable. I have a bunch of variants of the date I would like to use:

2022-07-05@19-54
July 5
July 5, 2022
2022-07-05@19-54-34
2022-07-05-19-54
07-Tue
7/5/22
2022-07-05

H:\Dropbox\photos\by-date\2022\2022-01\2022-01-08
H:\Dropbox\photos\by-date\2010s\2015\2015-01\2015-01-07-

ok, the last two I use on my computer

Just pop up a menu in your shortcut for the desired format. One extra step, but you are adding one extra level of choice and you have limited trigger options.

I use this Shortcut. I wrote it originally to be used on i*OS or on macOS (where direct insertion without using the clipboard is available).

Date Time Stamp

It displays the actual date and time in the menu to select from. Just add the custom formats you want to the text box and it will update the menu automatically.

Sample menu created:

EDIT:
I also use a text replacement shortcut to run the Shortcut from the pull down search bar from my home screen.

Pull down to get search bar → dts my text Sortcut for Date Time Stamp → tap Search → tap the Shortcut in the results

1 Like

I do something similar, only I invoke it via the iOS Share menu. I highlight the text just before the spot I want to insert the formatted date, and the shortcut is built to take the selected text, and construct a string that incorporates the selected text and the formatted date/time. Then I can just paste it, replacing the highlighted text.

I couldn’t figure a way to invoke the Share menu without having text selected. Otherwise it would be invoked without the highlighting step.

1 Like

Too bad iOS doesn’t allow triggering of Shortcuts via the Text Replacement feature…

2 Likes

I use this command-line app on my Mac to update a text replacement every day at midnight, which then syncs to all my devices via iCloud.

4 Likes

I’ve been on a quest to find or create (with assistance) a simple way to insert the current date and time on macOS and iOS/iPadOS. Here is the format that I would like it in? “2024-03-28 3:07 pm”
The main app that I would be using it in is the Notes app on both macOS and iOS/iPadOS. What is the cleanest way to invoke this action?

There are several options above. Which looks like the easiest for you to implement?

Alternatively, if you don’t mind the subscription, there is always TextExpander, utilising its keyboard on iOS.

That CLI text replacement option seems like a home run, but it hasn’t been updated since Apple’s Shortcuts got a desktop release and there seem to be some issues of the two conflicting.

The original developer hasn’t touched the code since Big Sur, but someone has fortunately forked it to deconflict with macOS Shortcuts:

Gonna give it a try when I get home. All I want is to be able to replace ‘ddate’ with a YYYYMMDD code, so this would be perfect.

The link to the short cut is fantastic and I was able to add it to my iPhone 13 Pro Max iOS Version 17.5.1

What I am being troubled with is actually getting it to enter the correct current time and day. When using the double tap it only pastes the time that was last copied.

You help would be greatly appreciated.

Here is my version of the shortcut:

https://www.icloud.com/shortcuts/46ba964ea36f4ece95b47aab3053d66d

–Robert Sterbal 412-977-3526

Hi @twp-steve.

This is the updated version of the Shortcut I have been using. It allows a date/time in the clipboard to be used or a date/time selected from the date picker as well as the current date. There are also more formatting options.

I use the Shortcut from a double backtap.

I’m not sure I understand the issue you are having, sorry. On the original Shortcut, it should be picking up the current date and time each time that you run the Shortcut. It does not (cannot) set a date/time format to insert the new current date/time in the selected format for future insertions – you need to run the Shortcut each time you want to insert a date/time.

If that is not the issue you are having, please drop in some more details and I’ll take a look and try to help.

I may have found a bit of an issue trying to run a version of this from the Share Sheet (not how I originally set it up to be run) where the app share menu gives a different result to the share menu in the pop-up over selected text. I’m running the iOS beta so not sure if that has any baring on it.

Anyway, off to work so I can’t look at it now.

Hi Tony, I found the solution to my problem. Thank you for your replies. I was not sure how to actually get the Shortcut to run. Every button I would press would not work. I then discovered that if I use the Accessibility feature with that Assistive Touch I can add the shortcut there and this actually produces the proper result from your version.

The problem that I was experiencing was that it was not running the prescribed run because I was simply clicking on the actions commands you had set in the coding.

Problem resolved.

1 Like

Sorry I hadn’t mentioned that that was how I ran the shortcut.

A slight simplification of your shortcut:

https://www.icloud.com/shortcuts/959c6b2238f44f0e81589de8c3c53acd