Date Calendar GregorianCalendar

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


If I extract a date from a node in Alfresco, I cannot cast directly to Calendar or GregorianCalendar. So I cast the Serializable return type from Alfresco to the Date class.
Date d = (java.util.Date) nodeService.getProperty(nr, INCENTROmodel.STARTDATE);


But java.util.Date is depricated since Java 1.1
The date.getTime() function still works.
It return the amount of ms since the beginning of time (aka 1 jan 1970)
long gt = d.getTime();


And the GregorianCalendar knows this. So
GregorianCalendar gc = new GregorianCalendar();

Post no. 3_million_and_1 about the java.util.Date / java.util.Calendar / java.util.GregorianCalendar


getting a boolean value from a Serializable return value (returned from nodeService.getProperty(X,Y);)

So this is the easy way to get a boolean value.

When all you have is a noderef with a boolean aspect (property)

boolean started = DefaultTypeConverter.INSTANCE.booleanValue(nodeService.getProperty(noderef, INCENTROmodel.PROP_TASKPLAN_TASK_STARTED));

boolean stopped = DefaultTypeConverter.INSTANCE.booleanValue(nodeService.getProperty(noderef, INCENTROmodel.PROP_TASKPLAN_TASK_ENDED));