[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Use of "DST" in ctime...

I noticed that "DST" is appended to time values in the wml frontend
in the following subroutine:

sub ctime {
    my ($time) = @_;

    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
    my ($str) = sprintf("%s %s %2d %02d:%02d:%02d 19%s%s",
         $dow[$wday], $moy[$mon], $mday, $hour, $min, $sec, $year,
         $isdst ?  " DST" : "");
    return $str;

A local user pointed out to me that the proper timezone here in the
Eastern US is "EDT" (Eastern Daylight Time, I guess).  "DST" isn't
meant to be a timezone at all, but it looks like one.  In fact, the
source for the perl ctime library says:

    # There's no portable way to find the system default timezone.

I suggest dropping it.

The routine above could be replaced by:

sub ctime {
    my ($time) = @_;

    return scalar(localtime($time));

| John Bazik        Comp Sci Dept, Box 1910 |
| 401-863-7624      Brown University        |
| jsb@cs.brown.edu  Providence, RI 02912    |
| http://www.cs.brown.edu/people/jsb/       |
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com