Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Oneechan69

macrumors 6502
Original poster
Mar 29, 2022
251
29
US
I want to be able to write a text like "155pm" and have that get turned into a date and then into an alarm on the same day with that time. I tried the set of actions shown below (link to shortcut), it works when I tried like "3pm" but not "155pm". Any ideas or solutions?
CleanShot 2024-08-24 at 05.43.19@2x.png
 

iStorm

macrumors 68020
Sep 18, 2012
2,023
2,426
"115pm" isn't really a valid time format. You'd need to use "1:15pm" instead.

Or depending on what you're using the shortcut for, swap out the 'Text' and 'Get dates from' actions with the 'Ask for Input' action to set the time that way. That will show iOS's time picker control.

1724522861147.jpeg


1724522875247.jpeg
 
  • Like
Reactions: NoBoMac

Oneechan69

macrumors 6502
Original poster
Mar 29, 2022
251
29
US
I want to input times that aren't properly formatted but are unambiguous, like "155pm".
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,244
4,931
What @iStorm said.

Getting dates from text can be hit or miss in Shortcuts, even when what seems to be a valid format. For example, I have some code that processes timestamp values, "yyyyMMddhhmmss", and Get Dates will choke on that.

sc.png

Per the description in the Format Date action and within Date objects themselves, Shortcuts are supposed to support date/time formats in RFC 2822, ISO 8601, or Unicode Technical Standard #35. Can look up those standards but what it basically boils down to is something like "1:15pm". Or in the above, "2024-08-24 09:30:05" would work.

sc2.png
 
  • Like
Reactions: HDFan
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.