NewDate

PowerBuilder Native Interface

IPB_Session interface:

NewDate method

Description

Creates a new pbdate data object.

Syntax

NewDate()

Return Values

pbdate.

Examples

This example tests whether a date value exists, and, if it does not, it creates a new pbdate object and sets its value to the first day in January, 1900:

if (ci->pArgs->GetAt(0)->IsNull())
{
   pArguments[i].date_val = Session->NewDate();

   Session->SetDate(pArguments[i].date_val,
      1900,1,1); // Date: 1900-01-01
   isNull[i]=true;
}
else
{
   pArguments[i].date_val =
      ci->pArgs->GetAt(i)->GetDate();
   isNull[i]=false;
}

Usage

The initial value is 1900-1-1.

See Also