Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date formatting in script

Status
Not open for further replies.

lent

MIS
Nov 1, 2001
6
US
I am new to scripting
I want to format date and time to search for directories
that are in ccyy/mm/dd/hh format
if I take the date how do I format it to look back and forward for day month or hour???

thanks for any help?????

Bull
 
Not entirely sure what you mean.

The command date +%Y/%m/%d/%H will give the current date in the format ccyy/mm/dd/hh

If you look at the man page for strftime you will get a list of all date formatting options.

Can you give more info on what you mean by "searching back and forward"?

Greg.
 
Thanks greg,

That part I knew
I am looking to back track and subtract from the day hour or month and format it properly...

Any quick suggestions



Thanks again

bull
 
have a look at faq80-953 - the shell script bit is at the bottom of the faq Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top