Converting a day number into day, month and yearΒΆ

decdate()

Convert a day number into day, month and year


SYNTAX

decdate(day, month, year, day_number)

This function decodes a Sculptor day number into its components.

day
month
year

Receiving fields for the day. month and year values, which are extracted from the day number provided. Day and month should be of type i1 or larger; year should be of type u2 or larger.

day_number

The day number of the date to be decoded. Day_number may be a field, or any expression that yields a valid Sculptor day. It is often a day number type field (formatted to the logical type /dn). Day number 1 represents the date 01/01/0001. See Logical types.

The return value of this function is the value of day_number.


NOTES

  • An alphanumeric representation of a date may be assigned to a day number type field, and it will be interpreted correctly. The alphanumeric string must contain a valid day, month and year, with a slash, full stop or space as a separator. The date format expected is the default date format in the file common in $SCULPTOR/text. See Default date format.


EXAMPLE

!temp Date,,i4/dn
!temp Day,,i4
!temp Month,,i4
!temp Year,,i4

     tmp.Date  = "6/11/1989"
     decdate (tmp.Day, tmp.Month, tmp.Year, tmp.Date)

The temps Day, Month and Year now contain the values 6, 11 and 1989 respectively.


RELATED TOPICS

encdate()