【help】set time"%A_YYYY%" without first two letters"YY"?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
amagaa
Posts: 12
Joined: 06 May 2019, 22:45

【help】set time"%A_YYYY%" without first two letters"YY"?

06 May 2019, 22:58

y::send,%A_YYYY%
dd::send,%A_YYYY%-%A_MM%-%A_DD%

now,send y,put out 2019.
but I just need 19, need to get rid of the first two letters 20.

how can I do this?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: 【help】set time"%A_YYYY%" without first two letters"YY"?

06 May 2019, 23:30

Here are 2 ideas. I'd use the FormatTime approach, as it's more reliable. E.g. if you concatenate variables, and if it's midnight when you get the time, you could end up with the correct day, but the previous month.

Code: Select all

:*:dd::
SendInput, % SubStr(A_YYYY "-" A_MM "-" A_DD, 3)
return

:*:d2::
FormatTime, vDate,, yy-MM-dd
SendInput, % vDate
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
just me
Posts: 9498
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: 【help】set time"%A_YYYY%" without first two letters"YY"?

07 May 2019, 01:19

... or just for y:

Code: Select all

y::Send, % SubStr(A_YYYY, 3)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Giresharu, Tvlao and 160 guests