in reply to User's time

This is probably a case for JavaScript, la. Feed it the UTC/GMT of whatever timestamp you want and use their computers' time to adjust it (or <noscript>present the UTC version</noscript> so it works for everyone regardless of JS). The best way around that is to do what PM does which is to let users set their TZ and store it with or parallel to their account info. Webusers can be from every timezone unless your site is an intranet or Singapore only setup or some such.

update: short demo of JS/perl solution, Perl + JavaScript to display "correct" local times for datetimes. Also linked below.

Replies are listed 'Best First'.
Re^2: User's time
by pg (Canon) on Oct 16, 2004 at 05:13 UTC

    Unless the time is largely used to determine the content, I would agree that you better get the date/time from the user's box. JavaScript is one way. To hardcode user date in the content makes the solution less portable. What if the user is traveling?

    The following script displays date in dd/mm/yy format, you can easily change it to different formats:

    <script language="JavaScript"> var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(day + "/" + month + "/" + year); </script>
Re^2: User's time
by kiat (Vicar) on Oct 16, 2004 at 04:33 UTC
    Thanks, I got it to work with the solution by kvale and graff :)