@Override
  public void configure(final MapredContext context) {
    super.configure(context);
    if (context != null) {
      formatter = InstantFormatter.ofConfiguration(context.getJobConf());
      String timeZoneStr = HiveConf.getVar(context.getJobConf(), HiveConf.ConfVars.HIVE_LOCAL_TIME_ZONE);
      timeZone = TimestampTZUtil.parseTimeZone(timeZoneStr);
    }
  }
GenericUDFDateFormat.

converts a date/timestamp/string to a value of string in the format specified
by the java date format
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateFormat.java