*BSD News Article 75777


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.reston.ans.net!newsfeed.internetmci.com!newsxfer2.itd.umich.edu!howland.erols.net!news1.erols.com!news
From: Ken Bigelow <kbigelow@www.play-hookey.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Changing default time format
Date: Fri, 09 Aug 1996 14:32:22 -0700
Organization: A poorly-installed InterNetNews site
Lines: 26
Message-ID: <320BAE66.603E@www.play-hookey.com>
References: <32061204.4FBC@dslab.com>
NNTP-Posting-Host: kenjb05.play-hookey.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (Win16; I)

Ian Wilkinson wrote:
> 
> I am working on getting server parsed HTML working, and I
> want to change the way that the date is formatted. Currently
> the date gets displayed as "Monday, 05-Aug-96 16:23:11"
> The APACHE grabs the date from FreeBSD.
> Is there an easy way to do this without mangling anything
> else?
> -IAN

Formatting the date for who? If you want to send the date in an alternate 
format to your Web pages, you can do it with CGI. I did a test page (not 
currently accessible on my site) to try this with a minimal shell script. 
The key lines were:

echo "The current time is: "`/bin/date +'%T'`
echo "The current date is: "`/bin/date +'%B %d, %Y'`

If you want to reformat the date in, say, your log files, you have some 
serious tinkering to do. I see no point to that.
-- 
Ken

Are you interested in   |
byte-sized education    |   http://www.play-hookey.com
over the Internet?      |