DateHotkey Script

Post your working scripts, libraries and tools
iuu
Posts: 2
Joined: 26 Nov 2020, 15:39
GitHub: tiuub

DateHotkey Script

Post by iuu » 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: 28
Joined: 07 Apr 2020, 11:53

Re: DateHotkey Script

Post by gibbons6546 » 08 May 2021, 06:48

Thanks for this, very useful.

iPhilip
Posts: 537
Joined: 02 Oct 2013, 12:21

Re: DateHotkey Script

Post by iPhilip » 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 v1.1+ (Unicode 32-bit)

iuu
Posts: 2
Joined: 26 Nov 2020, 15:39
GitHub: tiuub

Re: DateHotkey Script

Post by iuu » 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: 364
Joined: 06 Nov 2013, 16:35

Re: DateHotkey Script

Post by ahk7 » 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)

Post Reply

Return to “Scripts and Functions”