code: public static String getTimestamp(boolean withMsec) {
          return (withMsec ? SafeDateFormatter.getDateFormat(PATTERN_MSEC).format(new Date()) :
              SafeDateFormatter.getDateFormat(PATTERN).format(new Date()));
      }
docs: Get a ISO8601formatted string for the current date and time.
  
  @param withMsec flag indicating whether to include milliseconds
  @return a ISO8601 formatted string for the current date and time