I program the following code at linux peform to get server date time, however, for a machine that located to another office, it shows date time as “1899-12-30 00:00:00”.
The code as follow:
Function GetServerDateTime() As NotesDateTime
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As Notesdocument
Set db = session.CurrentDatabase
Set doc = db.CreateDocument
Set GetServerDateTime = New NotesDateTime( doc.Created )
End Function
nowtime = Format$(GetServerDateTime.LSLocalTime, "yyyy-mm-dd hh:nn:ss")
doc.RevisionHistoryDate = addElementToArray(nowtime,doc.RevisionHistoryDate)
Subject: RE: Show server date time difference for two machine
What you see there is a “zero” date/time value; it has not yet been assigned. The Created date doesn’t get assigned until you save the document.
@Now provides a better way to find out what time it is on a server. There may be a way to do it using LotusScript classes; if not you can use Evaluate.
Subject: RE: Show server date time difference for two machine
All machine in one office has no problem for the function, I mean that it has problem for machince located in another office. On the other hand, @Now will get user’s machine configured date and time, it only get server date and time if the agent runs on server.
Subject: RE: Show server date time difference for two machine
@Now( flags ; serverNames )Note The flags and serverNames parameters are new with Release 6.
Parameters
flags
Keyword or keyword list. Optional.
[SERVERTIME] gets the time-date from the server containing the database if serverNames is not specified or from serverNames ifserverNames is specified.