Re: access.log timestamps

From: Brian <signal@dont-contact.us>
Date: Fri, 22 May 1998 08:31:28 -0500 (CDT)

Will this return the correct time for the timezone my machine is
configured for, or is this giving me GMT and I have to calculate the
offset?

Brian

On Thu, 21 May 1998, Alex Rousskov wrote:

> On Thu, 21 May 1998, Brian wrote:
>
> > Is there a utility that will basically leave the logs the way they are
> > except convert the timestamp to a normal common time/date?
>
> The following script will do it for you. The script was designed for a
> different purpose so there is a better way to do what you ask for.
>
> $ ./ctime.pl < /usr/local/squid/logs/access.log | less
>
> Alex.
>
> -------------- ctime.pl ----------
>
> #!/usr/local/bin/perl -w
>
> while (<STDIN>) {
> if (/^\d+$/) {
> printf("%d = %s\n", $_, scalar gmtime($_));
> } else {
> while (/\b(\d{9})(?:\.\d\d\d)?\b/) {
> $_ = $` . scalar(gmtime($1)) . $';
> }
> print($_);
> }
> }
>

/-------------------------- signal@shreve.net -----------------------------\
| Brian Feeny | USR TC Hubs | ShreveNet Inc. (318)222-2638 |
| Network Administrator | Perl, Linux | Web hosting, online stores, |
| ShreveNet Inc. | USR Pilot | Dial-Up 14.4-56k, ISDN & LANs |
| 89 CRX DX w/MPFI, lots of |-=*:Quake:*=-| http://www.shreve.net/ |
| mods/Homepage coming soon |LordSignal/SN| Quake server: 208.206.76.47 |
\-------------------------- 318-222-2638 x109 -----------------------------/
Received on Fri May 22 1998 - 06:35:39 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:19 MST