Sample Code:
Date datobj;
Integer dy = datobj.day();
Integer mon = datobj.month();
Integer yr = datobj.year();
Date datobj;
Integer dy = datobj.day();
Integer mon = datobj.month();
Integer yr = datobj.year();