ShareShortcuts
Fork “Date Module”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so shortgram gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
59K
Saved
0
Actions
18
Category
Utilities
Version
3.1
Language
EN

To use the module you put inside your shortcut:

Text (for the format you want like time or date)

Run shortcut with text for input

What's New

Version 3.1

Updated comment, variable names, and the shortcut for iOS 15

Version History
3.1 Feb 8, 2022

Updated comment, variable names, and the shortcut for iOS 15

3.0 May 29, 2020

Instead of date_me and time_me it is now date_med and time_med

2.1 May 21, 2020

Updated comments

2.0 May 21, 2020

Added medium date and time format and change the inputs to get the outputs also added default string return

1.0 May 21, 2020

First release

What it does

18 actions
  1. Comment
    To use the module you put inside your shortcut: Text (for the format you want like time or date) Run shortcut with text for input Commands: time_sh date_sh time_med date_med
  2. Text
  3. Set Variable
    inputCommand
  4. Date
  5. Set Variable
    rightNow
  6. If
  7. Format Date
  8. If
  9. If
  10. Format Date
  11. If
  12. If
  13. Format Date
  14. If
  15. If
  16. Format Date
  17. If
  18. Text

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/calendar'
#define color darkgray
#define glyph gear

/*
To use the module you put inside your shortcut:
Text (for the format you want like time or date)
Run shortcut with text for input

Commands:
time_sh
date_sh
time_med
date_med
*/
@inputCommand = "{ShortcutInput}"
currentDate()
@rightNow

if @inputCommand contains "time_sh" {
	formatTimestamp(@rightNow, "None", "Short")
} else {
	if @inputCommand contains "time_med" {
		formatTimestamp(@rightNow, "None", "Medium")
	} else {
		if @inputCommand contains "date_sh" {
			formatTime(@rightNow, "None")
		} else {
			if @inputCommand contains "date_med" {
				formatTimestamp(@rightNow, "Medium", "None")
			} else {
			}
		}
	}
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

More by shortgram

See All

You Might Also Like

See All
Advertisement