FORMULA LANGUAGE


Time­date constants
A time-date constant consists of a time and/or a date enclosed in square brackets formatted as follows:
If time-date values are subtracted, the result is an integer that represents the difference between the times in seconds.

The table below shows the formats you can use to specify a date in a Notes field, assuming the operating system's default date format is US English and the year is 2002.

Tip Display Time must be selected in the Date/Time field properties box for the time to display. It is not selected by default.
Time-date formatConstantDate/Time field resultText field result
24-hour time[5:30]05:30 AM05:30:00 AM
12-hour time[5:30 PM]05:30 PM05:30:00 PM
24-hour time[17:30]05:30 PM05:30:00 PM
Date[6/15]06/15/200206/15/2002
Date[6/15/02]06/15/200206/15/2002
Time-date[6/15 5:30 PM]06/15/2002 05:30 PM06/15/2002 05:30:00 PM
Time-date[5:30 PM 6/15]06/15/2002 05:30 PM06/15/2002 05:30:00 PM
Difference[5:30 PM]-[5:30]43200.0043200

Specifying time zones

To specify a time zone in a Time zone field, you can select a zone from a drop-down list of options or use the functions @TimeZoneToText and @TextToTimeInZone to manipulate the formats in which time values display programmatically.

Notes converts and saves human-readable time zone values using the following time zone attributes:
Attribute Definition
ZTime zone offset from GMT.
DODaylight Saving Time (DST) observed flag. 1 means DST is in effect; 0 means it is not. If equal to 1, a value should be supplied for DL.
DLDST law identifying the <StartMonth> <StartWeek> <StartDayOfWeek> <EndMonth> <EndWeek> <EndDayOfWeek>.
ZX(Optional) Host-specific time zone index.
ZN(Optional) Time zone name.
For example, if you select "(GMT -05:00) Eastern Time (US & Canada)" from the Time zone drop-down list, Notes saves the value as:

Z=5$DO=1$DL=4 1 1 10 -1 1$ZX=25$ZN=Eastern

This indicates that the time zone is 5 hours before Greenwich Mean Time (-5). DST is in effect and starts in the month of April(4), during week 1, on day 1 of the week, which is a Sunday, and ends in October(10), during the last week (-1), also on a Sunday(1). The ZX and ZN attributes are values used exclusively by Notes.

If you use a Time zone field as the default value for a view column, it displays as a similar string of attribute and value pairs. Use @TimeZoneToText to convert the field to a human-readable format.

You can enter these attribute and value pairs as the default value for a Time zone field, or you can let the @TimeToTextInZone function do the work for you. For example, to display a box specifying the current time in Alaska, you could create a Hotspot button with this formula:


or you could create a Time zone field called zone from which the user could select the zone for which they would like to see the current time, then display that time in a message box by adding this formula to the Hotspot button:
See Also