Serializes date and writes it into specified buffer.
548091
private static void writeDate(Date date, CharBuf buffer) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.US);
        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
        buffer.addQuoted(formatter.format(date));
    }
171464
function write_dos_date(buf, date) {
	if(typeof date === "string") date = new Date(date);
	var hms = date.getHours();
	hms = hms << 6 | date.getMinutes();
	hms = hms << 5 | (date.getSeconds()>>>1);
	buf.write_shift(2, hms);
	var ymd = (date.getFullYear() - 1980);
	ymd = ymd << 4 | (date.getMonth()+1);
	ymd = ymd << 5 | date.getDate();
	buf.write_shift(2, ymd);
}
495087
function serializeAllDates(obj) {

        // if it is a date, then return serialized version
        if (_.isDate(obj)) {
            return serializeDate(obj);
        }

        // if array or object, loop over it
        if (_.isArray(obj) || _.isObject(obj)) {
            _.forEach(obj, function (item, key) {
                obj[key] = serializeAllDates(item);
            });
        }

        return obj;
    }
666571
def write_timestamp(self, v):
        """"""
        self.out.write(pack('>Q', long_t(calendar.timegm(v.utctimetuple()))))
1226830
public void writeByteBufferPart(byte[] buffer, int offset, int length)
        throws IOException
    {
        while (length > 0) {
            int sublen = length;

            if (0x8000 < sublen)
                sublen = 0x8000;

            os.write('b');
            os.write(sublen >> 8);
            os.write(sublen);

            os.write(buffer, offset, sublen);

            length -= sublen;
            offset += sublen;
        }
    }
606889
@Override
	protected void serializeTo(RawDataBuffer out)
    {
    	super.serializeTo(out);
        out.writeInt(browserId.asInt());
    }
812808
public static String write(Date value) {
		if (value==null) return null;
		String text = ThreadLocalDateFormatter.format(value, FULL);
		return text;
	}
66189
void writeToStream(DataOutput out) throws IOException {

        if (this == DEFAULT) {
            out.writeByte(0);
        } else {
            out.writeByte(NON_DEFAULT_MARKER);
            out.writeUTF(this.era.name());
            out.writeLong(this.start.get(EpochDays.MODIFIED_JULIAN_DATE));
            out.writeLong(this.end.get(EpochDays.MODIFIED_JULIAN_DATE));
        }

    }
897318
public void writeBinary(final PacketOutputStream pos) throws IOException {
    Calendar calendar = Calendar.getInstance(timeZone);
    calendar.setTimeInMillis(date.getTime());

    pos.write((byte) 7);//length
    pos.writeShort((short) calendar.get(Calendar.YEAR));
    pos.write((byte) ((calendar.get(Calendar.MONTH) + 1) & 0xff));
    pos.write((byte) (calendar.get(Calendar.DAY_OF_MONTH) & 0xff));
    pos.write((byte) 0);
    pos.write((byte) 0);
    pos.write((byte) 0);
  }
997236
public static int encodeGeneralizedTime(Date date, ByteBuffer buf) {
        if (date == null) {
            throw new IllegalArgumentException();
        }

        int pos = buf.position();
        SimpleDateFormat format = new SimpleDateFormat(GENERALIZED_TIME_FORMAT);
        format.setTimeZone(TimeZone.getTimeZone("GMT")); // always use UTC
        String value = format.format(date);
        byte[] data = value.getBytes();
        for (int i = data.length - 1; i >= 0; i--) {
            pos--;
            buf.put(pos, data[i]);
        }
        buf.position(buf.position() - data.length);
        int headerLength = DerUtils.encodeIdAndLength(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE,
                ASN1_GENERALIZED_TIME_TAG_NUM, data.length, buf);
        return headerLength + data.length;
    }
808012
@Override
	public Long serialize(Date value) {
		if (value != null) {
			return value.getTime();
		}
		return null;
	}
578854
def serialize(self, dt):
        
        if dt is None:
            return str(dt)
        return dt.strftime(self.date_format)
1190591
public void writeUTCDate(long time)
        throws IOException
    {
        if (SIZE < _offset + 32)
            flushBuffer();

        int offset = _offset;
        byte[] buffer = _buffer;

        if (time % 60000L == 0) {
            // compact date ::= x65 b3 b2 b1 b0

            long minutes = time / 60000L;

            if ((minutes >> 31) == 0 || (minutes >> 31) == -1) {
                buffer[offset++] = (byte) BC_DATE_MINUTE;
                buffer[offset++] = ((byte) (minutes >> 24));
                buffer[offset++] = ((byte) (minutes >> 16));
                buffer[offset++] = ((byte) (minutes >> 8));
                buffer[offset++] = ((byte) (minutes >> 0));

                _offset = offset;
                return;
            }
        }

        buffer[offset++] = (byte) BC_DATE;
        buffer[offset++] = ((byte) (time >> 56));
        buffer[offset++] = ((byte) (time >> 48));
        buffer[offset++] = ((byte) (time >> 40));
        buffer[offset++] = ((byte) (time >> 32));
        buffer[offset++] = ((byte) (time >> 24));
        buffer[offset++] = ((byte) (time >> 16));
        buffer[offset++] = ((byte) (time >> 8));
        buffer[offset++] = ((byte) (time));

        _offset = offset;
    }
1229826
public static String write(Calendar value) {
		if (value==null) return null;
		return DateUtils.write(value.getTime());
	}
1134946
public JsonElement serialize(Calendar src, Type typeOfSrc,
			JsonSerializationContext context) {
		int year = src.get(Calendar.YEAR);
		String month = this.formatter.format(Double.valueOf(src
				.get(Calendar.MONTH) + 1));
		String day = this.formatter.format(Double.valueOf(src
				.get(Calendar.DAY_OF_MONTH)));
		String hour = this.formatter.format(Double.valueOf(src
				.get(Calendar.HOUR_OF_DAY)));
		String minute = this.formatter.format(Double.valueOf(src
				.get(Calendar.MINUTE)));
		String formattedDate = year + "-" + month + "-" + day + "T" + hour
				+ ":" + minute;

		return context.serialize(formattedDate);
	}
789623
public void writeByteBufferPart(byte[] buffer, int offset, int length)
        throws IOException
    {
        while (length > 0) {
            flushIfFull();

            int sublen = _buffer.length - _offset;

            if (length < sublen)
                sublen = length;

            _buffer[_offset++] = BC_BINARY_CHUNK;
            _buffer[_offset++] = (byte) (sublen >> 8);
            _buffer[_offset++] = (byte) sublen;

            System.arraycopy(buffer, offset, _buffer, _offset, sublen);

            _offset += sublen;
            length -= sublen;
            offset += sublen;
        }
    }
747023
protected final void writeSerializedBytes(ObjectManagerByteArrayOutputStream buffer) {
        buffer.write(simpleSerialVersion);
        buffer.writeInt(objectStoreIdentifier);
        buffer.writeLong(storedObjectIdentifier);
    }