Serializes date and writes it into specified buffer.
353439
protected void writeDate(Date date, CharBuf buffer) {
        SimpleDateFormat formatter = new SimpleDateFormat(dateFormat, dateLocale);
        formatter.setTimeZone(timezone);
        buffer.addQuoted(formatter.format(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);
  }
117249
private void writeDateField(String fieldName, Object value) throws IOException
   {
      if (value instanceof String)
      {
         m_writer.writeNameValuePair(fieldName + "_text", (String) value);
      }
      else
      {
         Date val = (Date) value;
         m_writer.writeNameValuePair(fieldName, val);
      }
   }
117421
public void writeTo(final PacketOutputStream pos) throws IOException {
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern(
        fractionalSeconds ? "yyyy-MM-dd HH:mm:ss.SSSSSS" : "yyyy-MM-dd HH:mm:ss", Locale.ENGLISH);
    pos.write(QUOTE);
    pos.write(formatter.format(tz).getBytes());
    pos.write(QUOTE);
  }
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));
        }

    }
808012
@Override
	public Long serialize(Date value) {
		if (value != null) {
			return value.getTime();
		}
		return null;
	}
435784
private void appendDateTime(long epochMillis) {
        date.setTime(epochMillis);
        calendar.setTime(date);
        appendDate();
        write(' ');
        appendTime();
    }
922087
@Override
    public void write(ByteBuffer buffer) {
//        if (obj instanceof Persistable)
//            ((Persistable) obj).write(buffer);
//        else {
        if (obj != null)
            buffer.put(getSerialized());
        tmpBuffer = null;
//        }
    }
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;
        }
    }
555526
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
      buffer.put_int64((jd - DATE_REFERENCE) * MILLISECONDS_IN_DAY)
    end
1026421
public static void writeTo(ByteBuffer buffer, OutputStream out) throws IOException {
        if (buffer.hasArray()) {
            out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());
            // update buffer position, in way similar to non-array version of writeTo
            buffer.position(buffer.position() + buffer.remaining());
        } else {
            byte[] bytes = new byte[TEMP_BUFFER_SIZE];
            while (buffer.hasRemaining()) {
                int byteCountToWrite = Math.min(buffer.remaining(), TEMP_BUFFER_SIZE);
                buffer.get(bytes, 0, byteCountToWrite);
                out.write(bytes, 0, byteCountToWrite);
            }
        }
    }
265161
public void formatWriter(String text, Object bindObj, String dateFormat,
			Writer writer) throws IOException, FormatException
	{
		writer.write(format(text,bindObj,dateFormat));
	}
578854
def serialize(self, dt):
        
        if dt is None:
            return str(dt)
        return dt.strftime(self.date_format)
1257477
def _serialize(self, value, attr, obj):
        """"""
        try:
            return super(DateString, self)._serialize(
                arrow.get(value).date(), attr, obj)
        except ParserError:
            return missing
574399
def serialized(self, prepend_date=True):
        """"""
        name = self.serialized_name()
        datetime = self.serialized_time(prepend_date)
        return "%s %s" % (datetime, name)
142414
private void _serializeDateTime(DateTime dateTime, StringBuilder sb) {

	Calendar c = JREDateTimeUtil.getThreadCalendar(ThreadLocalPageContext.getTimeZone());
	c.setTime(dateTime);
	sb.append(goIn());
	sb.append("new Date(");
	sb.append(c.get(Calendar.YEAR));
	sb.append(",");
	sb.append(c.get(Calendar.MONTH));
	sb.append(",");
	sb.append(c.get(Calendar.DAY_OF_MONTH));
	sb.append(",");
	sb.append(c.get(Calendar.HOUR_OF_DAY));
	sb.append(",");
	sb.append(c.get(Calendar.MINUTE));
	sb.append(",");
	sb.append(c.get(Calendar.SECOND));
	sb.append(");");
    }
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;
    }