Code example for GregorianCalendar

Methods: setTimeInMillis, setTimeZone

0
        } 
 
        if (singleColumn)
        { 
            Timestamp ts = (Timestamp)getDatastoreMapping(0).getObject(resultSet, exprIndex[0]);
            GregorianCalendar cal = new GregorianCalendar();
            cal.setTimeInMillis(ts.getTime());
 
            String timezoneID = ec.getNucleusContext().getPersistenceConfiguration().getStringProperty("datanucleus.ServerTimeZoneID");
            if (timezoneID != null)
            { 
                // Apply server timezone ID since we dont know what it was upon persistence 
                cal.setTimeZone(TimeZone.getTimeZone(timezoneID));
            } 
            return cal;
        } 
        else 
        { 
            // (Timestamp millisecs, Timezone) implementation 
            long millisecs = getDatastoreMapping(0).getLong(resultSet, exprIndex[0]);