List of usage examples for org.joda.time ReadableDateTime getEra
int getEra();
From source file:org.efaps.db.databases.PostgreSQLDatabase.java
License:Apache License
/** * {@inheritDoc}./*from ww w.ja v a2 s. c o m*/ * <br/> * Postgres does not work with the year "ZERO" therefore the year * is translated like a Gregorian/Julian Calendar (ZERO = -1) */ @Override public String getStr4DateTime(final ReadableDateTime _value) { String ret; if (_value.getEra() == 0) { ret = _value.toDateTime().minusYears(1).toString(ISODateTimeFormat.dateHourMinuteSecondFraction()); ret = ret.substring(1) + " BC"; } else { ret = _value.toDateTime().toString(ISODateTimeFormat.dateHourMinuteSecondFraction()); } return ret; }