DateTime conversions
Attribute(s)
Date/Time Fields
Description
Make sure that Date/Time conversions are made independent of the server operating system.
Motivation
The date/time settings on the server can be changed, or applications can be used on more than one server with different servers. Developers should take this into account when designing applications.
Example / Details
In Notes and particularly Domino applications Date/Time fields must be used in such a way to be independent of the date/time setting on the operating system of the server. In Domino applications (and for agents in Notes applications), the date/time settings can be taken directly from the server operating system. If the client wishes that a date/time field has a certain standard format, the designer should create an application that is completely independent of the operating system in its display of date/time fields.
Even in cases where the client has not specifically requested this feature, it is important that the developer inform the client that date/time formats may vary from server to server. This information should also be included in the support documentation for System Administrators.
Example:
There are several constructions that could cause problems. The example below is only one construction that is not date/time format independent.
Be careful by any conversion of strings to time.
Never do this:
day:= 12
month := 4
year := 2002
@TextToTime(day+'-'+ month +'-'+year)