Gossamer Forum
Home : Products : DBMan : Installation :

Problem with Date Format

(Page 2 of 2)
> >
Quote Reply
Re: Problem with Date Format In reply to
Hi Chris,

I have had the same problem for the last six months, even after adding Carol's secure_lookup mod and bug fix's. Everything was working fine except for the log file, mine was showing a 1969 date. After seeing your post I said hey, that is something I still need to fix.

Well, I just finished messing around with the get_date sub and think I have figured out the problem. Let’s hope what I found is the final fix for this.

I use a modified get_date, mine is a get_date_and_time, but I am sure that what I found will apply to the original get_date sub. Just disregard the $sec, $min, and $hour lines.

New fixed
####################### G E T _ D A T E _ T I M E #################
sub get_date_time {

my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime(time());
($sec < 10) and ($sec = "0$sec");
($min < 10) and ($min = "0$min");
($hour < 10) and ($hour = "0$hour");
($day < 10) and ($day = "0$day");
$year = $year + 1900;

return "$months[$mon]-$day-$year $hour:$min:$sec";
}

What I did to fix it:
###################### G E T _ D A T E _ T I M E ##################
sub get_date_time {

my ($time1) = $_[0]; <--- remove this line
($time1) or ($time1 = time());<--- remove this line
my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time1);<--- change this
my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;<--- moved this line to top
($day < 10) and ($day = "0$day");
$year = $year + 1900;
($sec < 10) and ($sec = "0$sec");
($min < 10) and ($min = "0$min");
($hour < 10) and ($hour = "0$hour");

return "$months[$mon]-$day-$year $hour:$min:$sec";
}

I just did a quick check of my add record, modify record, and log file and everything is peachy. However, until this has been really tested for a week or two no guaranty’s Wink

If you try this fix please post your results so we know whether this is THE fix or not.

Cheers!

------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com



[This message has been edited by NgtCrwlr (edited November 03, 1999).]
> >