Get the next month end date


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Get the next month end date
# 1  
Old 02-20-2014
Get the next month end date

how to get the next month end date.
Code:
dt=01312014

output=02282014
# 2  
Old 02-21-2014
What have you attempted?
Take a look at this link. See, if you can get some hints.
# 3  
Old 02-26-2014
Try this

Try this

date -d "-$(date +%d) days +2 month" +%m%d%Y
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How bash treats literal date value and retrieve year, month and date?

Hi, I am trying to add few (say 3 days) to sysdate using - date -d '+ 3 days' +%y%m%d and it works as expected. But how to add few (say 3 days) to a literal date value and how bash treats a literal value as a date. Can we say just like in ORACLE TO_DATE that my given literal date value... (2 Replies)
Discussion started by: pointers1234
2 Replies

2. Shell Programming and Scripting

Not able to fetch previous month first date and last date

I am not able to fetch first date and last date previous month date -d -1month +%Y-%m-%d date -d -1month +%Y-%m-%d I need two format dd-mm-yyy previous month 01-03-2016 previous month 31-03-2016 and also only date 1 to 31 Aprriciate your replay (4 Replies)
Discussion started by: jagu
4 Replies

3. Shell Programming and Scripting

Help with getting last date of previous month and first date of previous 4th month from current date

I have requirment to get last date of previous month and the first date of previous 4th month: Example: Current date: 20130320 (yyyymmdd) Last date of previous month: 20130228 (yyyymmdd) First date of previous 4th month: 20121101 (yyyymmdd) In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies

4. Shell Programming and Scripting

Cron for end of month

Hello, I'm on FreeBSD 8.2-STABLE shell and I was trying the following cron entry for end of month: 59 23 * * * && /home/user/eomt.sh >/dev/null 2>&1 I get the following error Subject: Cron <user@shell> eomt.sh contains the following codes #!/bin/sh rm /home/user/tst/logs/* &&... (9 Replies)
Discussion started by: user`
9 Replies

5. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

6. Shell Programming and Scripting

Pass the first date and last date of previous month

Hi All, I need to run a job every month at the beginning of the month which is scheduled through autosys, lets say on 03/01/2010. I need to pass the last month's i.e February's first_date = 02/01/2010 and last_date = 02/28/2010 as variables to a stored procedure. Can somebody please pass... (2 Replies)
Discussion started by: vigdmab
2 Replies

7. Shell Programming and Scripting

fetching Month end using cal

Hi , Can someone please assist to get monthend using cal utility and monthend shouldn't be saturday or sunday. Cheers, gehlnar (2 Replies)
Discussion started by: gehlnar
2 Replies

8. Shell Programming and Scripting

End of Month - Cron Jobs

I am running AIX 5.3 with the default shell as ksh. I would like to know how to run a cron job on this system the last calendar day of the month. I found an example, but, I'm not sure if it will work with AIX and ksh... 02 16 * * * && /home/user/job-eom.kshI also need to be able to run a... (2 Replies)
Discussion started by: jthompson333
2 Replies

9. UNIX for Advanced & Expert Users

last month end date

Hi, How to get the lastmonth's end date? (have current date) through s shell script. I need to get it and pass it to a procedure. Please advice. Thanks in advance. (7 Replies)
Discussion started by: vanathi
7 Replies

10. UNIX for Advanced & Expert Users

Unix Cron Month End Processing

Is it possible to use cron to schedule a job that will run the first 3 Sunday's during a month in addition to the last day of the month? (3 Replies)
Discussion started by: cpete
3 Replies
Login or Register to Ask a Question