Change timestamp to new format string.

@param isoTimestamp the iso timestamp
@param newFormat    the new format
@return the string
761583
public static String changeTimestampToNewFormat(String isoTimestamp,
            DateTimeFormatter newFormat) {
        return ZonedDateTime.parse(isoTimestamp).format(newFormat);
    }
93691
public static String changeTimestampToIsoInstant(String dateFormat,
            String timestamp) {
        return getTime(changeTimestampToLong(getSimpleDateFormat(dateFormat),
                timestamp), ISO_INSTANT_Z, UTC_ZONE_ID);
    }
1083027
function fidjTimestampFormat(timestamp) {
    var date = new Date(timestamp);
    return fidjPadNumber(date.getFullYear(), 4) + '-' +
        fidjPadNumber(date.getMonth() + 1, 2) + '-' +
        fidjPadNumber(date.getDate(), 2) + ' ' +
        fidjPadNumber(date.getHours(), 2) + ':' +
        fidjPadNumber(date.getMinutes(), 2) + ':' +
        fidjPadNumber(date.getSeconds(), 2);
}
117545
public static Timestamp toTimestamp(DateTime dt) {
        if (dt == null) {
            return null;
        } else {
            return new Timestamp(dt.getMillis());
        }
    }
569839
public static long changeTimestampToLong(SimpleDateFormat simpleDateFormat,
            String timestamp) {
        try {
            synchronized (simpleDateFormat) {
                return simpleDateFormat.parse(timestamp).getTime();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
670331
public static long changeTimestampToLong(String dateFormat,
            String timestamp, String zoneId) {
        return changeTimestampToLong(getSimpleDateFormat(dateFormat, zoneId),
                timestamp);
    }
384222
public static java.sql.Timestamp toTimestamp(String date, String time) {
		java.util.Date newDate = toDate(date, time);

		if (newDate != null)
			return new java.sql.Timestamp(newDate.getTime());
		else
			return null;
	}
1329890
function createDateTimeParser( formatKey, fallbackFormatsKey, isoFormat ) {
   return ( options, str ) => {
      const val = `${str}`.trim();

      if( val.length === 0 ) {
         return success( null );
      }

      let formats = [ options[ formatKey ] ];
      if( options[ fallbackFormatsKey ] && options[ fallbackFormatsKey ].length ) {
         formats = options[ fallbackFormatsKey ].concat( formats );
      }

      const mDate = momentParse( str, formats, options );
      return mDate.isValid() ? success( mDate.format( isoFormat ) ) : error();
   };
}
726862
function createDateTimeFormatter( type, inputFormat ) {
   return ( options, value ) => {
      if( value == null ) {
         return '';
      }

      if( value instanceof Date ) {
         return format( moment( value ) );
      }

      if( typeof value !== 'string' ) {
         throw argumentError( value );
      }

      const useInputFormat = value.length < ISO_FULL_FORMAT_MIN_LENGTH;
      const momentTime = value.toLowerCase() === 'now' ?
         moment() :
         moment( value, useInputFormat ? inputFormat : undefined, useInputFormat || undefined );

      if( !momentTime.isValid() ) {
         throw argumentError( value );
      }

      return format( momentTime );

      ////////////////////////////////////////////////////////////////////////////////////////////////////////

      function format( momentTime ) {
         return momentTime.format( options[ `${type}Format` ] );
      }

      function argumentError( value ) {
         return new TypeError(
            'Expected argument to be a Date object, the string "NOW", or an ISO-8601 string ' +
            `(full, or ${type} as ${inputFormat}), but got "${typeof value}". Value: ${value}`
         );
      }
   };
}
370320
def iso8601timestamp(T=None, nanos=True, utc=False):
	""""""
	T  = time.time() if T is None else T
	Ti = math.floor(T)
	Tn = round((T-Ti)*1e9)
	if Tn >= 1e9:
		Ti += 1
		Tn  = 0
	
	s  = time.gmtime(Ti)      if utc   else time.localtime(Ti)
	f  = time.strftime("%Y%m%dT%H%M%S", s)
	n  = ".{:09d}".format(Tn) if nanos else ""
	tz = "Z"                  if utc   else time.strftime("%z", s)
	return f+n+tz
745382
public static Timestamp generateTimestamp() {
		Instant time = Instant.now();
		Timestamp timestamp = Timestamp.newBuilder().setSeconds(time.getEpochSecond())
				.setNanos(time.getNano()).build();
		return timestamp;
	}
1111763
private String convertTimestamp() {
    //some locales (for example, French) generate timestamp text with characters not included in \w -
    // now using \S (all non-whitespace characters) instead of /w 
    String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+");
    //make sure dots in timestamp are escaped
    result = result.replaceAll(Pattern.quote("."), "\\\\.");
    return result;
  }
39990
public static String changeFormatAndTimeZone(String isoTimestamp,
            String toBeTimeFormat) {
        return changeFormatAndTimeZone(isoTimestamp, toBeTimeFormat,
                DEFAULT_ZONE_ID);
    }
1366954
public static String getTimestamp(boolean withMsec) {
        return (withMsec ? SafeDateFormatter.getDateFormat(PATTERN_MSEC).format(new Date()) :
            SafeDateFormatter.getDateFormat(PATTERN).format(new Date()));
    }
235723
protected Timestamp readTimestamp() throws IOException {
		int inc = _in.readInt();
		int time = _in.readInt();
		return new Timestamp(time, inc);
	}
684633
public static Date toDate(String pString, String pFormat) {
        // Get the format from cache, or create new and insert
        // Return new date
        return toDate(pString, new SimpleDateFormat(pFormat));
    }
148146
public String getTimestampString()
    {
        if ( timestamp == null )
        {
            return null;
        }
        else
        {
            SimpleDateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" );
            fmt.setTimeZone( TimeZone.getTimeZone( "GMT" ) );
            return fmt.format( new Date( timestamp.longValue() ) );
        }
    }