Example usage for org.joda.time ReadableDateTime getYearOfCentury

List of usage examples for org.joda.time ReadableDateTime getYearOfCentury

Introduction

In this page you can find the example usage for org.joda.time ReadableDateTime getYearOfCentury.

Prototype

int getYearOfCentury();

Source Link

Document

Get the year of century field value.

Usage

From source file:com.barchart.feed.ddf.message.provider.CodecHelper.java

License:BSD License

/** time zone information is discarded */
static final void encodeTimeStamp(final ReadableDateTime dateTime, final ByteBuffer buffer) {

    // base fields
    buffer.put(DDF_CENTURY); // century
    buffer.put(encodeTimeStampByte(dateTime.getYearOfCentury())); // year
    buffer.put(encodeTimeStampByte(dateTime.getMonthOfYear())); // month
    buffer.put(encodeTimeStampByte(dateTime.getDayOfMonth())); // day
    buffer.put(encodeTimeStampByte(dateTime.getHourOfDay())); // hours
    buffer.put(encodeTimeStampByte(dateTime.getMinuteOfHour())); // minutes
    buffer.put(encodeTimeStampByte(dateTime.getSecondOfMinute())); // seconds

    // milliseconds
    final int millisOfSecond = dateTime.getMillisOfSecond();
    buffer.put((byte) (millisOfSecond & 0xFF)); // low byte
    buffer.put((byte) ((millisOfSecond >>> 8) & 0xFF)); // high byte

}