dddate.ahk

#Windows #AutoHotkey

This script inserts the date into the current cursor position after a hotkey is pressed.

#SingleInstance force

:R*?:DDD::
    if GetKeyState("LShift", "P") {
        FormatTime, CurrentDateTime, , yyy-MMM-dd
        SendInput %CurrentDateTime%
    }
     else {
        FormatTime, CurrentDateTime, , yyy-MM-dd
        SendInput %CurrentDateTime%
    }
return

:R*?:FFF::
    if GetKeyState("LShift", "P") {
        FormatTime, CurrentDate, , yyyyMMdd
        FormatTime, CurrentTime, , HHmmss-0400
        SendInput %CurrentDate% @ %CurrentTime%
    }
     else {
        FormatTime, CurrentDateTime, , yyyyMMddTHHmmss-0400
        SendInput %CurrentDateTime%
    }
return