By default, on the Web dates/times are displayed by Domino in the timezone of the server - or you can choose GMT with @Text formulas. What about if you want the date/time always displayed in the timezone of the user -- wherever they are?
The answer is to use JavaScript Date objects. Here's how...
Code:
In the form where you want to display dates on the Web in local format:
Create a function in the JS Header box:
function doDate (year, month, day, hour, minute) {
localDate = new Date (year, month, day, hour, minute, 0);
window.document.write ( localDate.toLocaleString( ) );
}
This takes the date components, creates a JavaScript Date object and then outputs the date in a format decided by the browser that matches the local PC timezone preferences. If the function is called whilst a Web page is being rendered by Domino, the date text will appear at the point in the document where the function is called.
Go to date/time field on your form and add this on a separate line:
<SCRIPT LANGUAGE=
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

"JavaScript">
<!--
doDate ( <Computed Value> );
// -->
</SCRIPT>
Mark the entire text 'Pass-Thru HTML' and select 'Hide when previewed for editing'.
Select the original field and mark it 'Hide when previewed for reading'. In this way you can edit dates/times as normal but they are displayed via the doDate function.
Finally, the <Computed Value> is created with the following formula (where 'My_Date' is the name of my date/time field):
@Text(@Year(My_Date)) + ", " +
@Text(@Month(My_Date) - 1) + ", " +
@Text(@Day(My_Date)) + ", " +
@Text(@Hour(My_Date)) + ", " +
@Text(@Minute(My_Date))
Note that month value is reduced by one, as javascript Date objects start with Jan = 0.
Thus when Domino is rendering a document that uses this form, it computes the values from the My_Date field that will be passed to the doDate function. The browser then receives the page and, whilst parsing it, processes the doDate function locally -- which then inserts the correct localised date/time string.