Formats date as ISO 8601 timestamp
183331
private String getFormattedTimestamp(int offset) {
        SimpleDateFormat df = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
        df.setTimeZone(TimeZone.getTimeZone("UTC"));

        if (overriddenDate != null) {
            return df.format(overriddenDate);
        } else {
            return df.format(getSignatureDate(offset));
        }
    }
1314237
def formatdt(date: datetime.date, include_time: bool = True) -> str:
    
    if include_time:
        return date.strftime("%Y-%m-%dT%H:%M")
    else:
        return date.strftime("%Y-%m-%d")
1056805
def iso8601(self):
        """"""
        # Get a timezone-naive datetime.
        dt = self.datetime(naive=True)
        return '{}Z'.format(dt.isoformat())
399219
def format_timestamp(t):
    """"""
    # Timestamp is only valid for 1678 to 2262
    try:
        datetime_str = str(pd.Timestamp(t))
    except OutOfBoundsDatetime:
        datetime_str = str(t)

    try:
        date_str, time_str = datetime_str.split()
    except ValueError:
        # catch NaT and others that don't split nicely
        return datetime_str
    else:
        if time_str == '00:00:00':
            return date_str
        else:
            return '{}T{}'.format(date_str, time_str)
1249311
def pp_timestamp(t):
    
    if t is None:
        return ''
    h, m, s = int(t / 3600), int(t / 60 % 60), t % 60
    return "%02d:%02d:%05.2f" % (h, m, s)
1140593
def date_to_timestamp(date):
    
    date_tuple = date.timetuple()
    timestamp = calendar.timegm(date_tuple) * 1000
    return timestamp
616375
function isIso8601DateString(value) {
    var regex = /^([+-]\d{6}|\d{4})(-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?)?$/;

    // Verify that it's in ISO 8601 format (via the regex) and that it represents a valid day (via Date.parse)
    return regex.test(value) && !isNaN(Date.parse(value));
  }
1103914
function(date) {    
            function format(number) {
                // Format integers to have at least two digits.
                return (number < 10) ? '0' + number : number;
            }
            return '"' + date.getFullYear() + '-' +
                    format(date.getMonth() + 1) + '-' +
                    format(date.getDate()) + 'T' +
                    format(date.getHours()) + ':' +
                    format(date.getMinutes()) + ':' +
                    format(date.getSeconds()) + '"';
        }
188585
def _serialize_date(value):
    """"""
    if not isinstance(value, date):
        raise ValueError(u'The received object was not a date: '
                         u'{} {}'.format(type(value), value))
    return value.isoformat()
771477
def execute_cast_simple_literal_to_timestamp(op, data, type, **kwargs):
    """"""
    return pd.Timestamp(data, tz=type.timezone)
4224
def validate_format_iso8601(validator, fieldname, value, format_option):
    
    try:
        iso8601.parse_date(value)
    except ValueError:
        raise ValidationError(
            "Value %(value)r of field '%(fieldname)s' is not in "
            "'iso8601 YYYY-MM-DDThh:mm:ss(+/-)hh:mm' format" % locals())
792092
function formatDate( date ) {

	var dateString = '';

	date = new Date( date );

	dateString = date.getMonth() + 1;
	dateString += '/';
	dateString += date.getDate();
	dateString += '/';
	dateString += date.getFullYear();

	return dateString;
}
945253
public static String encodeDate(Date date) {
        SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
        /* Java doesn't handle ISO8601 nicely: need to add ':' manually */
        String result = dateFormatter.format(date);
        return result.substring(0, result.length() - 2) + ":" + result.substring(result.length() - 2);
    }
253047
private String dateToExplicitTimestampUTC( Date date )
    {
        DateFormat df = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
        df.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
        return "TS: " + df.format( date ) + "Z";
    }
265281
def format_date(cls, timestamp):
        
        if not timestamp:
            raise DateTimeFormatterException('timestamp must a valid string {}'.format(timestamp))

        return timestamp.strftime(cls.DATE_FORMAT)
605125
def serialize_date(attr, **kwargs):
        
        if isinstance(attr, str):
            attr = isodate.parse_date(attr)
        t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day)
        return t
679407
public static String format( TimeZone timeZone, Date date ) {
        return format( DateFormat.DATE_FORMAT_STR_ISO8601, timeZone, date );
    }