Forums Register Login

get the next date in unix

+Pie Number of slices to send: Send
Hi,

Is there any script or command to get the next date of the given date?

For ex , if i give YYYYMMDD - > 20090930,

It should give : 20091001


Please help.

---Yuga
+Pie Number of slices to send: Send
Hi,

Anyone can reply please. It is little emergency.

Thanks
+Pie Number of slices to send: Send
http://faq.javaranch.com/java/EaseUp

You want to do this with a script as in shell script?
For java, check out the Calendar/GregorianCalendar add and roll methods.
+Pie Number of slices to send: Send
Hi,

I am trying to get the code using shell script.
I have tried the following code:



but i am getting pervious date.

--Yuga
+Pie Number of slices to send: Send
Please don't misuse color in your posts - if the code is all in red, then I don't want to read it. I have put your code between [code] and [/code] ubb code blocks.

You haven't specified which version of Unix you are using, or even if you are using the GNU date application.

If I were trying to achieve what you are asking for, and I had access to GNU date (default on Linux), then I would use:If I don't have access to GNU date, then I could always work it out for myself. Something like:

You may have just won ten million dollars! Or, maybe a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5021 times.
Similar Threads
Unable to get Tomcat on Windows XP on available port:80 with IIS 6 on port:8080
Problem with Devakas Final Exam Q on Static Thread methods
Sequencing Records
How to take dynamic values of textboxes to Action class
unix split command
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:12:54.