Using TDateTime

Explains how to set Date and Time.

TDateTime()

The example below shows how to construct a TDateTime object, initialising it to midnight 6th January 1996;

       
        
       
       TDateTime dateTime(1996,EJanuary,5,00,00,00,000000);
      

Set()

When setting the day and month, subtract one because the ranges are offset from zero. For example, to set the date to 31st December 1996:

       
        
       
       TDateTime dateTime;
TInt year=1996, month=12, day=31;
dateTime.Set(year,TMonth(month-1),day-1,0,0,0,0);