Example usage for org.joda.time LocalDateTime getChronology

List of usage examples for org.joda.time LocalDateTime getChronology

Introduction

In this page you can find the example usage for org.joda.time LocalDateTime getChronology.

Prototype

public Chronology getChronology() 

Source Link

Document

Gets the chronology of the datetime.

Usage

From source file:de.javakaffee.kryoserializers.jodatime.JodaLocalDateTimeSerializer.java

License:Apache License

@Override
public void write(Kryo kryo, Output output, LocalDateTime localDateTime) {
    final int packedYearMonthDay = localDateTime.getYear() * 13 * 32 + localDateTime.getMonthOfYear() * 32
            + localDateTime.getDayOfMonth();
    output.writeLong((long) packedYearMonthDay * 86400000 + localDateTime.getMillisOfDay(), true);
    final String chronologyId = IdentifiableChronology.getChronologyId(localDateTime.getChronology());
    output.writeString(chronologyId == null ? "" : chronologyId);
}