At the bottom of the main page, where it says "All times are PST" (on Scream's board), it might be good to print the current time as seen by the server (e.g. 3:00pm PST) so that users could see how much their time zone is shifted so they can mentally adjust the post times.
Bill Dimm, <A HREF="http://MagPortal.com/" target="_new">MagPortal.com</A> - find magazine articles
How about, thinking along those lines, letting users enter a GMT offset of where THEY are, and let the board calculate everything according to where THEY are?
e.g., if I am in CA, and post something at 09:00am, and someone in NY looks at it, let it tell them it was posted at 12noon.
I took a look at Date::Manip and two things from the authors manual that I didn't like. Slow and one of the largest CPAN modules around. As much as the date command is used when building pages this probably wouldn't be a good idea.
I would like to provide this feature. Probably the easiest way would be to have an offset in your profile. So it would look something like:
Server time is 12:37 PM. Choose your time offset in hours (...,-2,-1,0,1,2,...)
And then all dates would reflect your personal time offset. But I'm not sure that is very intuitive.
This was discussed a while ago <A HREF="http://www.wwwthreads.com/perl/showthreaded.pl?Cat=&Board=wishlist&Number=18654&page=&view=&sb=&vc=1#Post18654" target="_new">here</A>. One thing that could get confusing is that I think daylight savings time causes the difference between the local time zone and GMT to not be constant. Daylight savings time does not start (or was it end?) at the exact same time in Europe and the US - quite a mess.
Bill Dimm, <A HREF="http://MagPortal.com/" target="_new">MagPortal.com</A> - find magazine articles
>>Server time is 12:37 PM. Choose your time offset in hours (...,-2,-1,0,1,2,...)
And then all dates would reflect your personal time offset. But I'm not sure that is very intuitive.<<
They'll have to do it the "guess and verify" way we Administrators do it now. I also think chosing the offset from GMT would be better - most people already know that for their local time. <img src="http://www.amdragon.com/images/eileensig.gif" alt=" - " />
In order to use a GMT offset this would require a GMT offset variable in w3tvars.pm and then one in the user profile. This actually wouldn't be too difficult as all the calculations would be in the convert time function. But, part of setup would be to figure out the GMT offset of where your server is located. So for instance, in my case I would put in -7 for this variable. Does this sound too complicated?
The only problem with running everything off of GMT is the daylight savings time issue. Whereas if you use the standard time call, daylight savings is already taken into consideration when reporting the time back.
--- Scream <A HREF="http://www.wcsoft.net" target="_new">http://www.wcsoft.net</A><P ID="edit"><FONT SIZE=-1><EM>Edited by Scream on 9/27/00 10:25 AM.</EM></FONT>
Going back to my original thought of a standard offset against the server time it really wouldn't be a guess if the date and time were displayed right above the form box for the offset.
Meaning, if you saw
Current server time is Tuesday, September 27 12:37 PM
Then you could look at your clock and see what offset you need. Trying to deal with GMT and daylight savings would be a cludge at best and still may not work for all timezones. Whereas a simple time offset would be quite simple.
Yes, of course, you're right. I'd forgotten how I keep having to change my 'guess' to allow for Daylight Saving. Let's go with a standard offset against the server time displayed right above the form box for the offset.
Ok, this is done on the devel site. In your display preferences you can choose your offset. On the main page where it used to show the server timezone it shows the current time with your offset in place. And everywhere a date/time is displayed it takes your offset into consideration.
--- Scream <A HREF="http://www.wcsoft.net" target="_new">http://www.wcsoft.net</A><P ID="edit"><FONT SIZE=-1><EM>Edited by Scream on 9/27/00 11:58 AM.</EM></FONT>
Looks good to me. You might consider making "your offset" into a link to either the display preferences (only works if they are logged in of course) or a small explanation page.
Bill Dimm, <A HREF="http://MagPortal.com/" target="_new">MagPortal.com</A> - find magazine articles
Nice. At Amdragon I put a link to a personalized <A HREF="http://www.timeanddate.com/worldclock/" target="_new">World Clock</A> so they can compare (selected) times across the world.
I am somewhat late on this thread because of my server change but if I may still have a say... Id suggest going one step further in the <font color=blue>Current server time is: Wed Oct 4 09:58:30 2000 Choose your time offset in hours (..,-2,-1,0,1,2,..)</font color=blue> thing:
Instead of that, why not have a select list of times, something like:
<font color=red>What time is it where you are at? [select list].</font color=red>
That is..: <form> <select name="select"> <option value="-1">Oct 4 08:58:30</option> <option value="+0" selected>Oct 4, 09:58:30</option> <option value="+1">Oct 4, 10:58:30</option> <option value="+2">Oct 5, 11:58:30</option> </select> </form> and so on...
I do like the offset date thing, saves my poor wee brain from doing any maths. Notice I said "maths" rather than "math". Yup, I'm a Brit, and your month/day/year date system gives me much more of a headache than adding a few hours onto the time in 24hr clock. So I'm asking for an option in Display Preferences to display the time in DMY format. That would, in the words of Graham Greene's novel Brighton, rock
Did you know? You can use old motor oil to fertilise your lawn.
Yes, that would be nice... but either way, I'm excited about this feature! <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />
Muhammad Chishti Creative dIRECTOR <font color=white><A HREF="http://www.imcuniverse.com" target="_new">http://www.imcuniverse.com</A></font color=white>
We use this new 'short4' called more european-friendly time format: MM-DD-YY 24:00: simply make the following additions to w3t.pm / convert_time and check 'short4' in w3ttheme.pm: (new code between #>>>)
sub convert_time { ... my ($hour,$min,$sec)=split(/:/,$tarray[3]);
#>>> new $hour24 my $hour24=$hour; #>>> ... elsif ($theme{'timeformat'} eq "short3") { $time="$year/$months{$tarray[1]}/$tarray[2] $hour:$min $AMPM"; }
#>>> new format "short4": MM-DD-YY 24:00 elsif ($theme{'timeformat'} eq "short4") { if ($months{$tarray[1]}<10) { $months{$tarray[1]}="0$months{$tarray[1]}"; } if ($tarray[2]<10) { $tarray[2]="0$tarray[2]"; } $time="$months{$tarray[1]}-$tarray[2]-$year $hour24:$min"; } #>>> ...
I'm in the interesting position of being BOTH a Brit AND an Naturalized Colonial Upstart so I go with the recommended Universal format. This is what I have:
In w3t.pm:
########################################################################### # convert_time: converts the time to a useable format ########################################################################### sub convert_time {
my $time = shift; $time = localtime($time); if($theme{'timeformat'} =~/^short/) {
# Which time format to use. The short format is Y2K compliant <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" /> # long = 'Sun Mar 7 13:19:48 1999'; # short1 = 'MM/DD/YY 01:19 PM'; # short2 = 'DD/MM/YY 01:19 PM'; # short3 = 'YY/MM/DD 01:19 PM'; # Scream's short4 was = 'DD/MM/YYYY 10:19'; # but My short4 = 'YY/MM/DD 13:19'; $theme{'timeformat'} = 'short4';
M/D/Y is total bollocks as you Brits would say but who am I to argue with 250 million Yanks. Maybe that can be next on the list after they finally get rid of fractions on the stock exchange.
Regarding BillD's original question, I used to display the time on the server in a little frame refreshing every couple of minutes. The script was called TimeIt, you can grab it from <A HREF="http://thecgipath.hypermart.net/products/s_timeit.html" target="_new">http://thecgipath.hypermart.net/products/s_timeit.html</A>. If you want to include the time in your perl script it would be easy to do by picking the important bits out of TimeIt and including it in the perl script. The number of different formats you can use to display time/date is the real benefit of TimeIt.