Hi,
could you please suggest a method to add and subtract a certain number of
days to a date in Unix, i.e. the date returned by the "date" command?
Thank you in advance.
Br.
Diego.
could you please suggest a method to add and subtract a certain number of
days to a date in Unix, i.e. the date returned by the "date" command?
Thank you in advance.
Br.
Diego.
RTFFAQ.Quote:> could you please suggest a method to add and subtract a certain number of
> days to a date in Unix, i.e. the date returned by the "date" command?
--
Stphane ["Stephane.Chazelas" at "free.fr"]
Where is that documented? "printf --man" speaks of "%T", butQuote:> The recent versions of ksh93 have also quite good datetime
> handling capabilities, i.e.
> 'printf "%T\n" "exactly tomorrow"` will produce the same output as
> previous, excepting the locale issues.
I can see some indications in the source code for the "format"
in the "usage" variable in src/lib/libcmd/date.c (sort of
strftime-like not compatible with SUSv3 strftime, but with
interesting extensions).
I couldn't find anywhere information about "exactly tomorrow".
There's also src/lib/libast/man/tm.3, but it's not of much help.
--
Stphane ["Stephane.Chazelas" at "free.fr"]
http://home.comcast.net/~j.p.h/cus-faq.html#G
Joe
--
I think people should be able to make up their own minds for me
- Monty Python
Quote:> Hi,
> could you please suggest a method to add and subtract a certain number of
> days to a date in Unix, i.e. the date returned by the "date" command?
> Thank you in advance.
> Br.
> Diego.
So, what about Reading The Fine FAQ and telling us why theQuote:> Hi,
> I forgot to specify that my environment is Hp Hp-ux 11.0.
> D.
http://home.comcast.net/~j.p.h/cus-faq.html
http://www.faqs.org/faqs/by-newsgroup/comp/comp.unix.shell.html
http://groups.google.com/groups?q=wide_strftime&scoring=d
--
Stphane ["Stephane.Chazelas" at "free.fr"]
As you suggested, I found the solution of my problem here:
http://groups.google.com/groups?q=wide_strftime&hl=en&lr=&ie=UTF-8&sc...
and in the excellent caljd.sh tool (thanks to A. Clay Stephenson).
Thank you again.
D.
Quote:> Hi,
> could you please suggest a method to add and subtract a certain number of
> days to a date in Unix, i.e. the date returned by the "date" command?
> Thank you in advance.
> Br.
> Diego.
Hi all,
Can someone tell me if there is a convenient way to do date addition
and subtraction in a Korne shell script ?
e.g. I want a date 3 days and do a:
mydate=((`date` - 3))
Something like this.
Thanks and regards,
Kenneth
2. Sending printer commands through remote queues
4. XFree_S3 garbeled fonts on SPEA V7
5. Date Function on Unix (hp-ux)
8. Intercepting mobile fone text/voice calls
10. Fortran-callable date function
11. crypt() and date() function
13. SSI kills javascript date functions . . .