You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Service script for inserting Date in a month as text format

I'm trying to insert the current date into my writing apps in these formats:

Nov. 18, 2024

18 Nov 2024

18-Nov-24 (or -2024)

I would like some help please with an Automator script that results in an alphanumeric format and not DD/MM/YYYY. I looked up past solutions, but they seem to be mostly the latter, unless I missed other posts that show other fixes.


At present, I have Automator run the following script as a service that only produces the mentioned numerical date format when inserted into an app like Pages or Notes:

tell (current date) as ¬
	«class isot» as string to return the ¬
	contents of [text 1 thru 10] as text



MacBook Pro 13″, macOS 11.7

Posted on Nov 17, 2024 6:31 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 18, 2024 4:08 AM

See strftime(3) for following date codes:


# Nov. 18, 2024
set date1 to (do shell script "date -j \"+%b. %d, %Y\"")
# 18 Nov 2024
set date2 to (do shell script "date -j \"+%d %b %Y\"")
# 18-Nov-2024
set date3 to (do shell script "date -j \"+%d-%b-%Y\"")
# 18-Nov-24
set date4 to (do shell script "date -j \"+%d-%b-%y\"")

3 replies
Question marked as Top-ranking reply

Nov 18, 2024 4:08 AM in response to Yasher258

See strftime(3) for following date codes:


# Nov. 18, 2024
set date1 to (do shell script "date -j \"+%b. %d, %Y\"")
# 18 Nov 2024
set date2 to (do shell script "date -j \"+%d %b %Y\"")
# 18-Nov-2024
set date3 to (do shell script "date -j \"+%d-%b-%Y\"")
# 18-Nov-24
set date4 to (do shell script "date -j \"+%d-%b-%y\"")

Service script for inserting Date in a month as text format

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.