DateHotkey Script

Post your working scripts, libraries and tools for AHK v1.1 and older
iuu
Posts: 5
Joined: 26 Nov 2020, 15:39
Contact:

DateHotkey Script

28 Apr 2021, 16:05

Hello,

I want to showcase you my DateHotkey Script.
It can be used to retrieve the current date, the date of yesterday, the date of tomorrow and many more.

I have posted everything on GitHub. Just give it a try:
https://github.com/tiuub/DateHotkey

Here are some examples of the hotkeys which can be used:
Hotkey - Description
#yesterday - Date of yesterday
#saturday - Date of saturday this week
#we - Date of wednesday this week
#today+4days-6weeks - Todays Date, plus 4 days and minus 6 weeks
#monday+4days-2days - Date of monday in the week, comming in 2 days
#tu4days+6w - Date of tuesday in the week, comming in 4 days and 6 weeks
#yesterday4d6w3months - Yesterdays Date, plus 4 days, 6 weeks and 3 months
#tomorrow2y4d6w - Tomorrows Date, plus 2 years, 4 days and 6 weeks
#su500d40y2m - Date of sunday in the week, comming in 500 days, 40 years and 2 months
#calendarweek4w - Calendar week in 4 weeks
#cw3d2w4m - Calendar week in 3 days, 2 weeks and 4 months
Last edited by gregster on 28 Apr 2021, 16:12, edited 1 time in total.
Reason: Topic moved to 'Scripts and Functions' (AHK v1) - was AutoHotkey 'v2 Scripts and Functions' - since it isn't AHK v2 code.
gibbons6546
Posts: 31
Joined: 07 Apr 2020, 11:53

Re: DateHotkey Script

08 May 2021, 06:48

Thanks for this, very useful.
iPhilip
Posts: 827
Joined: 02 Oct 2013, 12:21

Re: DateHotkey Script

12 May 2021, 12:29

Hi @iuu,

Thank you for this interesting work. I can see some uses for myself. The following are suggestions that would make it better for me:

  • Allow the user to specify the set of characters used as ending characters. Currently it appears that `n is the only allowed ending character. Personally, I would default to a space.
  • Use the date format according to the rules of the current user's locale. Currently today's date is being displayed as 12.05.2021. In my locale it would be written as 5/12/2021. You could try using the GetDateFormatEx function to accomplish that.
Thank you.

- iPhilip
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
iuu
Posts: 5
Joined: 26 Nov 2020, 15:39
Contact:

Re: DateHotkey Script

23 Jun 2021, 15:31

iPhilip wrote:
12 May 2021, 12:29
Hi @iuu,

Thank you for this interesting work. I can see some uses for myself. The following are suggestions that would make it better for me:

  • Allow the user to specify the set of characters used as ending characters. Currently it appears that `n is the only allowed ending character. Personally, I would default to a space.
  • Use the date format according to the rules of the current user's locale. Currently today's date is being displayed as 12.05.2021. In my locale it would be written as 5/12/2021. You could try using the GetDateFormatEx function to accomplish that.
Thank you.

- iPhilip
Hi @iPhilip,

sorry for my delayed answer. I didn't received a notification about your comment.
Anyway, I will implement this in the following days.

Kind regards
ahk7
Posts: 575
Joined: 06 Nov 2013, 16:35

Re: DateHotkey Script

26 Jun 2021, 06:54

1. Have you looked at the Ln (LCID) option of FormatTime for locale usage?
2. Looks like you're using hotstrings.ahk but I don't reference to the source and which version you are using (there is one by titan (very old) and on by menixator (a bit news, but some updates on the forum I think) - perhaps document that for references (github/forum thread)
iuu
Posts: 5
Joined: 26 Nov 2020, 15:39
Contact:

Re: DateHotkey Script

07 Aug 2021, 06:37

Finally, I have uploaded a big update today.
With this update you can set your own date format, ending/recognition key and your favourite language.

I hope you enjoy it!

GitHub: https://github.com/tiuub/DateHotkey

Kind regards
Guillaumed
Posts: 1
Joined: 16 Aug 2021, 08:03

Re: DateHotkey Script

16 Aug 2021, 08:09

Hi guys,
I am a beginner with AHK and I found out this script which I hope can be useful for me.
The thing is I don't know how to use it. I tested the .exe file and also the ahk file, opened notepad, but if I write "#today" or "#we" then click on enter key nothing happen.
How it means to work please.
Regards
Jasonosaj
Posts: 53
Joined: 02 Feb 2022, 15:02
Location: California

Re: DateHotkey Script

15 Feb 2022, 12:53

Any chance that you'd add a subtract date option? Would love to be able to calculate past dates in addition to future ones.
iuu
Posts: 5
Joined: 26 Nov 2020, 15:39
Contact:

Re: DateHotkey Script

04 Jul 2022, 12:03

Hey @Jasonosaj ,

this is already implemented. You can basically type in #today-2d. So its the current date minus 2 days. (So you have to type in a "-" (minus) in front of the number.) This is available for all prefixes.

Kind regards
iuu
Posts: 5
Joined: 26 Nov 2020, 15:39
Contact:

Re: DateHotkey Script

04 Jul 2022, 12:07

Hi @Guillaumed,

just check your language settings for the script. Maybe its set to German (so you have to use #heute and #mittwoch and so on).
To change this open your traybar, right-click on the DateHotkey-Script icon, hover selection and select your prefered language.

Kind regards
ozzii
Posts: 484
Joined: 30 Oct 2013, 06:04

Re: DateHotkey Script

05 Jul 2022, 04:05

Guillaumed wrote:
16 Aug 2021, 08:09
Hi guys,
I am a beginner with AHK and I found out this script which I hope can be useful for me.
The thing is I don't know how to use it. I tested the .exe file and also the ahk file, opened notepad, but if I write "#today" or "#we" then click on enter key nothing happen.
How it means to work please.
Regards
Hi,
Same for me.
tested under Notepad++ and nothing happened.

Also, anyway to change the # for calling the function?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: DateHotkey Script

05 Jul 2022, 04:42

@iuu - Danke für's Scheren :mrgreen: BUT the whole script is shouting HOTSTRINGS! so why you've named it Date-Hotkey, with a Hotkey-description for Hotstrings? :think:
ahk7
Posts: 575
Joined: 06 Nov 2013, 16:35

Re: DateHotkey Script

06 Jul 2022, 15:09

@BoBo perhaps a play on AutoHotkey -> DateHotkey :think:

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 82 guests