About This Code
Brief Description:
Getting the Server Time from LotusScript
Contributor:
David B Bohlin
Last Modified:
12 Sep 2006
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
The NotesDateTime class when it is instanciated gets its time from the local machine. If you want to get a consitant value from the server it is possible to use the new feature (6.0 or later) for the @function @Now using a designated server to get the time. This allows us to set the time for the NotesDateTime class by using the following formula evaluation:
Usage / Example
Dim aVarResult As Variant
aVarResult = Evaluate("@Now([ServerTime] : [LocalTimeOnError]; @ServerName)")
Dim aNDTNow As New NotesDateTime(aVarResult(0))