Date Time Stamp Applescript formatting result is odd in Sonoma
I have programmed an AppleScript as a Service with the following code:
on run {input, parameters}
set thedate to (current date) as string
tell application "System Events"
keystroke thedate
end tell
end run
******
The result is Tuesday, January 30, 2024 at 5:39:56aPM.
I cannot figure out what the "a" before the "PM" means or how to remove it so that the end result is:
Tuesday, January 30, 2024 at 5:39:56 PM
Any help would be greatly appreciated!
MacBook Pro 16″, macOS 14.3