NeoCal Documentation

NeoCal for Palm OS User Guide

Moments

Moments are stored internally as the number of seconds elapsed since January 1, 1904. Currently, only date and times through December 31, 2031 are supported. This is subject to change in a future version of NeoCal.

There are three date moment registers which are used for entering date and time values. They are:

  • The button is used for entering dates using a Y.MMDD format. For convenience, years less than 32 are assumed to be in the 21st century and years between 32 and 99 are assumed to be in the 20th century.
  • The button is used for entering times using a 24 hour H.MMSS format.
  • The button recalls the current date and time.

In addition to resetting the date conversion registers, the also clears or resets the date moment registers to January 1, 1904 12:00 am.

Pressing the or buttons while entering a number will convert the number already in the x register. Otherwise, pressing one of these buttons will display a dialog for entering the desired value. In both cases, the value will be stored in that register for later recall.

Note: The Enter Time dialog is only available for versions of Palm OS 3.1 and later.

For example,

  1. Pressing enters August 28, 2002 and stores it into the date register.
  2. Pressing enters 2:30 pm and stores it into the time register.
  3. Pressing generates August 28, 2002 2:30 pm (the current date and time) and stores it into the now register.
  4. Pressing displays a dialog for entering a date and stores that date into the date register.
  5. Pressing recalls the last generated date and time value (August 28, 2002 2:30 pm) from the now register.

There are two moment conversion functions:

  • for extracting the date part of a moment
  • for extracting the time part of a moment

For example,

  1. Pressing generates August 28, 2002 2:45 pm.
  2. Pressing returns August 28, 2002 as a date value.
  3. Pressing recalls August 28, 2002 2:45 pm into the x register.
  4. Pressing returns 2:45 pm as a time value.

In addition, the following duration conversion functions will extract a portion of a moment:

  • for extracting the year from a date or datetime value
  • for extracting the month from a date or datetime value
  • for extracting the day from a date or datetime value
  • for extracting the hour from a time or datetime value
  • for extracting the minute from a time or datetime value
  • for extracting the second from a time or datetime value

For example,

  1. Pressing generates August 28, 2002 3:00 pm.
  2. Pressing returns 2002.
  3. Pressing recalls August 28, 2002 3:00 pm into the x register.
  4. Pressing returns 15.