Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

time offset

Quote Reply
time offset

My server is in the us, and I am in Norway...Is it possible to set "time-offset" so that the clock will show the right time in my time?



Quote Reply
Re: time offset In reply to
That would be a good thing to add to the next Links version. The reason it would not be very easy, is that the date/time is figured in several places (or could be) so you'd want to ensure a uniform time display.

If you were only using static pages, and no time display on the search.cgi pages, you could set the validate routines to add n-hours to the date/time stamps when records are set up.

If you have a DEDICATED server, you can set the TZ variable on the server to allow for whatever offset you want. Ask your ISP about that.

I don't know if there is a way to set your TZ variable in the webserver itself, I know you can do it on the logs, but I don't know if you can do it with all system calls. Nothing showed up in the Apache docs.

I would imagine that with the updates coming out, being able to set a TZ variable in Links would be on the list. If not, when the next version comes out, it should not be too hard to implement it as a mod to the program, once all the date/time calls are isolated.

There is a :

sub get_time {
# --------------------------------------------------------
# Return current time (self may or may not be an object).
my $self = shift;
my $time = shift || time;
ref $self or ($time = $self || time);

my ($sec, $min, $hour, $day, $mon, $year, $wday, $dst) = localtime $time;
($sec < 10) and ($sec = "0" . int $sec);
($min < 10) and ($min = "0" . int $min);
($hour < 10) and ($hour = "0" . int $hour);

return "$hour:$min:$sec";
But I don't know if every call for the time goes through that, and because an offset can easily span a day + or -, you'd have to make sure that all calls returned a date/time and you used only the parts you wanted.

FAQ: http://www.postcards.com/FAQ/LinkSQL/