code: public static int encodeTime(long javaDateTime) {
          Calendar cal = Calendar.getInstance();
          cal.setTimeInMillis(javaDateTime);
          return 2048 * cal.get(Calendar.HOUR_OF_DAY) + 32 * cal.get(Calendar.MINUTE) +
                  cal.get(Calendar.SECOND) / 2;
      }
docs: Encode a java date/time into a 16-bit encoded DOS time
  
  @param javaDateTime
  @return long