Bug 9500 - `edithook' is not Y2K compliant
Summary: `edithook' is not Y2K compliant
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-01-15 05:30 UTC by Peter Jeremy
Modified: 1999-05-04 04:43 UTC (History)
0 users

See Also:


Attachments
file.diff (426 bytes, patch)
1999-01-15 05:30 UTC, Peter Jeremy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Jeremy 1999-01-15 05:30:00 UTC
The `edithook' script in the CVSROOT directory uses a raw tm_year and
will therefore display 01/01/100 for 2000-JAN-01.

How-To-Repeat: 
Code inspection
Comment 1 danny 1999-01-15 10:36:16 UTC
On Fri, 15 Jan 1999, Peter Jeremy wrote:
> >Number:         9500
> >Category:       misc
> >Synopsis:       `edithook' is not Y2K compliant
> 
> The `edithook' script in the CVSROOT directory uses a raw tm_year and
> will therefore display 01/01/100 for 2000-JAN-01.

> 	
> --- /3.0/CVSROOT/edithook	Tue Mar 28 17:57:13 1995
> +++ ./edithook	Fri Jan 15 14:46:37 1999
> @@ -276,7 +276,7 @@
>  
>  sub create_timestamps {
>      ($sec,$min,$hour,$mday,$mon,$year) = localtime;
> -    $today	= sprintf("%02d/%02d/%02d", $mon+1, $mday, $year);
> +    $today	= sprintf("%02d/%02d/%04d", $mon+1, $mday, $year + 1900);
>      $nowtime	= sprintf("%02d:%02d:%02d", $hour, $min, $sec);
>      $date	= $today . ' ' . $nowtime;

This should really be

    $today	= sprintf("%d/%02d/%02d", $year + 1900, $mon+1, $mday);

ie. yyyy/mm/dd, not mm/dd/yyyy

Any objections to changing the log date format thus?
Comment 2 Tim Vanderhoek 1999-01-15 22:03:26 UTC
On Fri, Jan 15, 1999 at 12:47:07PM -0500, Bill Fumerola wrote:
> 
> >      $today	= sprintf("%d/%02d/%02d", $year + 1900, $mon+1, $mday);
> >  ie. yyyy/mm/dd, not mm/dd/yyyy
> >  
> >  Any objections to changing the log date format thus?
> 
> Yes. What is your foundation for the new format? Perhaps this is just my
> American citizenship coming through, but mm/dd/yyyy is the way most people

Which is really just a good argument for converting it to something
that is (relatively) internationalization-neutral.


-- 
This .sig is not innovative, witty, or profund.
Comment 3 nrahlstr freebsd_committer freebsd_triage 1999-05-04 04:41:30 UTC
State Changed
From-To: open->closed

Fixed in revision 1.2 by danny@FreeBSD.org.