How do I get yesterday's date in standard C-shells

How do I get yesterday's date in standard C-shells

Post by Randy CH » Tue, 20 Feb 1996 04:00:00



This is a related question to one that was posted earlier.

How can I get yesterday's date, or that for the day before yesterday?
Does the standard C-shell command 'date' does that neatly?

I am using the usual C-shells.

Thanks!

 
 
 

How do I get yesterday's date in standard C-shells

Post by Pete Form » Tue, 27 Feb 1996 04:00:00


    Randy> How can I get yesterday's date, or that for the day before
    Randy> yesterday?  Does the standard C-shell command 'date' does
    Randy> that neatly?

Add 24 hours to your usual timezone.  E.g. if TZ is set to JST-9, then

    env TZ=XXX15 date

Users of sh, ksh, etc. do not need the env.
--
Pete Forman
Western Geophysical


 
 
 

How do I get yesterday's date in standard C-shells

Post by Joan Colle » Fri, 01 Mar 1996 04:00:00




>     Randy> How can I get yesterday's date, or that for the day before
>     Randy> yesterday?  Does the standard C-shell command 'date' does
>     Randy> that neatly?

> Add 24 hours to your usual timezone.  E.g. if TZ is set to JST-9, then

>     env TZ=XXX15 date

> Users of sh, ksh, etc. do not need the env.
> --
> Pete Forman
> Western Geophysical


Oh! to live West of Greenwich.

Joan.
Sydney
Australia

 
 
 

1. Korn shell date cmd - getting yesterday's date

Is there an easy way of figuring yesterday's date based on using the
$(date) function.  The problems comes into play when I am trying to
pull a file with yesterday's date and today happens to be the 1st of
the month.  How can I figure out what the last day of the previous
month was?  I know there is an easy way in perl to do this, but I was
hoping there was a trick to it in Korn shell.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. irc on masqed machines

3. Get day before yesterday's and yesterday's date.

4. Self-taught/teaching Security

5. Calculating yesterday's date using GNU 'date' (was Re: Require a script)

6. Linux Red Hat Newbie! Internet Dial-up

7. Getting Yesterday's Date

8. Creating Boot Disk

9. Yesterdays's date from a shell script

10. shell script to display yesterday's date and time?

11. yesterday's date under the shell

12. Get "date '+%y%m%d'" for yesterday?