Hello Everybody,
i'm new here so hello to all one more time.
I have a problem with date calculation. Namely, i need script to return the last day of the previous month.
Unfortunately, my code does not work at all.
My idea was to determine the first day of the present month and then subtract 1 to achieve last day of the previous one.
i need this date in format dd.mm.yyyy and i'm working in US windows
Here's the code:
leaveDate = 01/%A_YYYY%/%A_MM%
FormatTime, fileDate, leaveDate, 01.MM.yyyy
output_date := fileDate
listvars
;output_date += -1, days ; does not work
FormatTime, FormattedDate2, %output_date%, dd.MM.yyyy
MsgBox, %fileDate%
Last day of the previous month Topic is solved
Re: Last day of the previous month
I hope that this helps you... http://www.autohotkey.com/board/topic/7 ... entry51188
Re: Last day of the previous month
Code: Select all
TDate := A_YYYY A_MM "01" ; Start Date of Current Month
TDate += -1, D ; End Date of Previous Month
FormatTime, fileDate, %TDate%, dd.MM.yyyy
MsgBox, %fileDate%
Re: Last day of the previous month
less talk and more code! test and hit the spot~