Examples of withChronology()


Examples of org.joda.time.DateTime.withChronology()

        }
    }

    public void testSampleDate1() {
        DateTime dt = new DateTime(1945, 11, 12, 0, 0, 0, 0, ISO_UTC);
        dt = dt.withChronology(ISLAMIC_UTC);
        assertEquals(IslamicChronology.AH, dt.getEra());
        assertEquals(14, dt.getCenturyOfEra())// TODO confirm
        assertEquals(64, dt.getYearOfCentury());
        assertEquals(1364, dt.getYearOfEra());
       
View Full Code Here

Examples of org.joda.time.DateTime.withChronology()

        assertEquals(0, dt.getMillisOfSecond());
    }

    public void testSampleDate2() {
        DateTime dt = new DateTime(2005, 11, 26, 0, 0, 0, 0, ISO_UTC);
        dt = dt.withChronology(ISLAMIC_UTC);
        assertEquals(IslamicChronology.AH, dt.getEra());
        assertEquals(15, dt.getCenturyOfEra())// TODO confirm
        assertEquals(26, dt.getYearOfCentury());
        assertEquals(1426, dt.getYearOfEra());
       
View Full Code Here

Examples of org.joda.time.DateTime.withChronology()

    }

    //-----------------------------------------------------------------------
    public void testEpoch() {
        DateTime epoch = new DateTime(1, 1, 1, 0, 0, 0, 0, ETHIOPIC_UTC);
        assertEquals(new DateTime(8, 8, 29, 0, 0, 0, 0, JULIAN_UTC), epoch.withChronology(JULIAN_UTC));
    }

    public void testEra() {
        assertEquals(1, EthiopicChronology.EE);
        try {
View Full Code Here

Examples of org.joda.time.DateTime.withChronology()

  @Override
  public void sendReminder(Mother mother, String type) {
    //mainForm = MainForm.getInstance();
    DateTime eddGreg = new DateTime(mother.getEdd());
    LocalDate eddEth = eddGreg.withChronology(EthiopicChronology.getInstance()).toLocalDate();
    String date = eddEth.getDayOfMonth() + "/" + eddEth.getMonthOfYear() + "/" + eddEth.getYear();
    String gott = (mother.getGott() == null) ? "Urban" : mother.getGott();
    String template = "ID: " + mother.getSeqId() + "\n" + mother.getFullName() + "\n" + gott + "\nEDD: " + date;
   
        SmsMessageHandler messageHandler = new SmsMessageHandler();
View Full Code Here

Examples of org.joda.time.DateTime.withChronology()

                if (!reminderAlreadySent) {
                    textMessageDao.changeStatus(textMessage, "A");
                    mainForm.setLogText("\nReminder to be written to database ...");
                    DateTime eddGreg = new DateTime(mother.getEdd());
                    LocalDate eddEth = eddGreg.withChronology(EthiopicChronology.getInstance()).toLocalDate();
                    String date = eddEth.getDayOfMonth() + "/" + eddEth.getMonthOfYear() + "/" + eddEth.getYear();
                    String gott = (mother.getGott() == null) ? "Urban" : mother.getGott();
                    String template = "ID: " + mother.getSeqId() + "\n" + mother.getFullName() + "\n" + gott + "\nEDD: " + date;

                    Reminder reminder = new Reminder();
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.withChronology()

     * @return date format used to string'ify date objects
     */
    public static DateTimeFormatter getSAMLDateFormatter() {
        if (dateFormatter == null) {
            DateTimeFormatter formatter = DateTimeFormat.forPattern(defaultDateFormat);
            dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
        }

        return dateFormatter;
    }

View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.withChronology()

     *
     * @param format date format used to string'ify date objects
     */
    public static void setSAMLDateFormat(String format) {
        DateTimeFormatter formatter = DateTimeFormat.forPattern(format);
        dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
    }

    /**
     * Gets the artifact factory for the library.
     *
 
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.withChronology()

     * @return date format used to string'ify date objects
     */
    public static DateTimeFormatter getSAMLDateFormatter() {
        if (dateFormatter == null) {
            DateTimeFormatter formatter = DateTimeFormat.forPattern(defaultDateFormat);
            dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
        }

        return dateFormatter;
    }

View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.withChronology()

     *
     * @param format date format used to string'ify date objects
     */
    public static void setSAMLDateFormat(String format) {
        DateTimeFormatter formatter = DateTimeFormat.forPattern(format);
        dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
    }

    /**
     * Gets the artifact factory for the library.
     *
 
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.withChronology()

     *
     * @return re-parsable string
     */
    public String toString() {
        DateTimeFormatter printer = ISODateTimeFormat.dateHourMinuteSecondFraction();
        printer = printer.withChronology(getChronology());
        StringBuffer buf = new StringBuffer(48);
        printer.printTo(buf, getStartMillis());
        buf.append('/');
        printer.printTo(buf, getEndMillis());
        return buf.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.