Need server date/time in javascript

Hello,

I try to fill a field in my form with an exact date/time of an action.

I need to get the server date/time in javascript.

I tried the new date() in JS but it returns the local date/time, wich may be false.

I tried also to call an agent to fill my field using LS, but i get a new window saying “agent done”.

Here is the code of the JS action :

location=“http://xxx.xxxx.fr/dev/dev.nsf/test?openagent”;

Here is the code of the LS agent (named “test”):

Sub Initialize

Dim s As New NotesSession

Dim curdoc As NotesDocument

Set curdoc=s.documentcontext

curdoc.date3=Now

End Sub

If i call then agent from a button with @command([toolsrunmacro];“test”)it works properly.

If i call it from the JS, got a blank page with “agent done”.

Please help.

TIA

Subject: Need server date/time in javascript

You have to use the print statement to output anything to the browser. If you want to use it in JavaScript, you could output the javascript from the agent using script tags.If you want to access the document context, you have to do a http://server.com/db.nsf/form?OpenForm and have a WebQueryAgent doing the work with filling the fields, if it cannot be done with @formulas.

  • Johan

johan@kanngard.net

http://dev.kanngard.net