Problem solve Get help with specific problems with your technologies, process and projects.

Obtaining a Domino server's time

How do you get Domino server time? I tried the following code but it didn't work. Lotus Notes always uses local/workstation time when you use/define NotesDateTime. The easiest way to get a server's time is to use this code:

Function GetServerTime as variant 
Dim ses As New NotesSession 
Dim db As notesDatabase 
Dim doc As notesDocument 
Dim dt As Variant 
Set db = ses.currentDatabase 
Set doc = New NotesDocument(db) 
dt = doc.created 
Call doc.remove(True) 
GetServerTime = dt 
End function 

I would have used this expression:
Evaluate({@Now([SERVERTIME]; "}
 & db.server & {")}) 

But your way is also good. You don't need the call to doc.Remove. Since you never saved the document, just let the doc variable fall out of scope and there will not be a document created.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...