Setting the last day of a month during rename

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Setting the last day of a month during rename Sun Jun 12, 2016 5:04 am • by pja
I am renaming some bank statements and wish to include the statement date in the filename.
The statement contains only the month and year. Each statement ends on the last day of the month.

Problem: some months have 30 days, some 31 days and Feb has 28 days most years.

Question: Is there a way to set the date to always be the last day of the month?
pja
 
Posts: 5
Joined: Sat Sep 01, 2007 4:54 am

pja wrote:I am renaming some bank statements and wish to include the statement date in the filename.
The statement contains only the month and year. Each statement ends on the last day of the month.

Problem: some months have 30 days, some 31 days and Feb has 28 days most years.

Question: Is there a way to set the date to always be the last day of the month?

Can you test the month:
- if Jan, Mar, etc then day = 31
- if Apr, Jun, etc then day = 30
- if … a bit more complicated
Dave61
 
Posts: 114
Joined: Tue Jul 10, 2012 4:56 pm

Does anyone have an answer to this problem?
I can extract the Month and Year but in the file rename, I want to insert the last day of that month.
andre.ct
 
Posts: 1
Joined: Fri Mar 24, 2017 8:22 am

You'll probably need to use a script as there's not built-in way to do something like this (at least not without having something like a rule per day of the month and using a different date adjustment for each one).
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron