![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Collecting & Displaying of Last User ID and Date of Last Login | amittal | Shell Programming and Scripting | 1 | 03-21-2007 09:18 PM |
| Collecting & Displaying of Last User ID and Date of Last Login | amittal | UNIX for Dummies Questions & Answers | 1 | 03-21-2007 10:51 AM |
| Displaying file names before a particular creation date | dhruv_saksena | UNIX for Dummies Questions & Answers | 1 | 09-02-2005 05:19 AM |
| displaying with ls | vivekshankar | UNIX for Dummies Questions & Answers | 2 | 05-23-2005 12:46 PM |
| Displaying what a command is doing/has done | quantumechanix | UNIX for Dummies Questions & Answers | 1 | 07-02-2003 05:40 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
displaying date
Hi All,
When I type date..I get the date, time ..etc displayed ...but can someone help me to display yesterdays date... some script to display back dates. Thanks in advance Minaz |
| Forum Sponsor | ||
|
|
|
#3
|
|||
|
|||
|
Thanx RTM !!!
Isn't there any OS built system utility e.g. something like "sysdate" Also I chked the post u suggested. Another query --- When I type # date Wed Nov 13 13:54:09 CST 2002 #d=`TZ=a30 date +%a' '%b' '%e' '%T' '%Z' '%Y` #echo $d Tue Nov 12 13:54:38 a 2002 Now, Can you pls. help me how to display the Time Zone properly. Regds, Minaz |
|
#4
|
||||
|
||||
|
There is not a sysdate in UNIX.
As far as your command, why are you setting the TZ and where are you getting the information? This is the portion that is incorrect. (fyi - you don't need all those quotes) $ d=`date +'%a %b %e %T %Z %Y'` $ echo $d Wed Nov 13 15:55:37 EST 2002 |
|
#5
|
||||
|
||||
|
What Unix are you using?
There may be a different answer if you're on Linux or if you have GNU Date installed... |
|
#6
|
|||
|
|||
|
I did it another way. Put a cron to run at 2315 daily to create a file with yesterday's date in whatever format u need. ANd read the file when u want. It is not the most elegant solution but it works for me!!
|
|
#7
|
|||
|
|||
|
I'm using SunOS 5.7
RTM - Thanx for the " quotes thing " but after setting TZ=a30, I get yesterday's date. Similarly I dont just want yesterday's date..it can be any number of days back. Just for additional knowledge, if u can help me out with the timezone error then it would be great. Anyways, i got a script which converts the date to any number of days back. Thanx all for ur replies. Minaz |
|||
| Google The UNIX and Linux Forums |