public long getMilliseconds(TimeZone aTimeZone){
    Integer year = getYear();
    Integer month = getMonth();
    Integer day = getDay();
    //coerce missing times to 0:
    Integer hour = getHour() == null ? 0 : getHour();
    Integer minute = getMinute() == null ? 0 : getMinute();
    Integer second = getSecond() == null ? 0 : getSecond();
    Integer nanos = getNanoseconds() == null ? 0 : getNanoseconds();
    
    Calendar calendar = new GregorianCalendar(aTimeZone);
    calendar.set(Calendar.YEAR, year);
    calendar.set(Calendar.MONTH, month-1); // 0-based
    calendar.set(Calendar.DAY_OF_MONTH, day);
    calendar.set(Calendar.HOUR_OF_DAY, hour); // 0..23
    calendar.set(Calendar.MINUTE, minute);
    calendar.set(Calendar.SECOND, second);
    calendar.set(Calendar.MILLISECOND, nanos/1000000);
    
    return calendar.getTimeInMillis();
  }