Here you can find the source of isBeforeCommonEra(Date date)
private static boolean isBeforeCommonEra(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; public class Main { /**/*www. j a va2 s .com*/ * The UTC time zone. */ private static final ThreadLocal<TimeZone> UTC_TZ = new ThreadLocal<TimeZone>() { @Override protected TimeZone initialValue() { return TimeZone.getTimeZone("UTC"); } }; /** * Returns true if the date is before the common era. */ private static boolean isBeforeCommonEra(Date date) { Calendar cal = getCalendarUTC(); cal.setTime(date); return cal.get(Calendar.ERA) == GregorianCalendar.BC; } /** * Get a UTC calendar with Locale US. */ private static Calendar getCalendarUTC() { return new GregorianCalendar(UTC_TZ.get(), Locale.US); } }