I'm a new user - thanks for your patience!
I send emails every week with dates & date ranges. I would like to have a few choices in my date library that are out of the norm.
Current - Fridays date - ie. Friday 5/29/20
Last Week date range = Sunday to Saturday ie. 2020-05-17 thru 2020-05-23
Current Weeks date range = Sunday to Saturday ie. 2020-05-24-20 thru 2020-05-30
Any help on this would be greatly appreciated.
Tom
New User Question on Dates
You would need to know a bit of scripting (Type: Command) to do this. There are many built-in variables and date calculation/formatting methods available.
https://www.autohotkey.com/docs/Variables.htm#WDay
https://www.autohotkey.com/docs/commands/EnvAdd.htm
https://www.autohotkey.com/docs/command ... _sensitive
For example A_WDay variable is a current 1-digit day of the week (1-7). 1 is Sunday, 2 is Monday etc. The following scripts check the current day of the week and calculate the difference to another date. I think you get the idea and can develop your dates.
https://www.autohotkey.com/docs/Variables.htm#WDay
https://www.autohotkey.com/docs/commands/EnvAdd.htm
https://www.autohotkey.com/docs/command ... _sensitive
For example A_WDay variable is a current 1-digit day of the week (1-7). 1 is Sunday, 2 is Monday etc. The following scripts check the current day of the week and calculate the difference to another date. I think you get the idea and can develop your dates.
Code: Select all
;Next Monday
date := A_Now ;gets current date
date += 9-A_WDay, Days ;adds (9 - current day of the week) to current date = next Monday
FormatTime, date, %date%, dd/MM/yyyy ; formats the date
msgbox % "Next Monday: " date "`n"
Send, % "Next Monday: " date "`n"
;Next Friday
date := A_Now
date += 13-A_WDay, Days
FormatTime, date, %date%, dd/MM/yyyy
Send, % "Next Friday: " date "`n"
;Last Monday
date := A_Now
date += A_WDay-12, Days
FormatTime, date, %date%, dd/MM/yyyy
Send, % "Last Monday: " date "`n"
;Last Friday
date := A_Now
date += A_WDay-8, Days
FormatTime, date, %date%, dd/MM/yyyy
Send, % "Last Friday: " date
I need something similar - I have to refer to week numbers daily, Fastkeys has an option but displays it directly after the 4digit year, i.e. 202027. Could you add a predefined variable for just the week number ? You already have one for the day of the year (which is also useful) so this should be no big thing ?
Thank you
Thank you
Thanks, we will implement this in one of the next releases.
Until then you could extract the week number like this (Type: Command):
Until then you could extract the week number like this (Type: Command):
Code: Select all
Week := SubStr(A_YWeek, -1)