code: public static DateItem fromString(String code) {
          String[] items = code.split("\n");
          if(items.length != 6) return null;
          int year, month, day, id;
          try {
              year = Integer.parseInt(items[2]);
              month = Integer.parseInt(items[3]);
              day = Integer.parseInt(items[4]);
              id = Integer.parseInt(items[5]);
          }
          catch (NumberFormatException e) {
              e.printStackTrace();
              return null;
          }
          return new DateItem(emptyToNull(items[0]), emptyToNull(items[1]), year, month, day, id);
      }
docs: Constructs a new TimeItem from a String previously gotten from the {@link #toString()} method.
  @param code The string to parse from.
  @return A new TimeItem, or null if there was an error.