Example usage for org.joda.time LocalDateTime LocalDateTime

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

Introduction

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

Prototype

public LocalDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour,
        int secondOfMinute, int millisOfSecond) 

Source Link

Document

Constructs an instance set to the specified date and time using ISOChronology.

Usage

From source file:org.fixb.impl.NativeFixFieldExtractor.java

License:Apache License

private LocalDateTime toLocalDateTime(String value) {
    int[] f = extractTimeFields(value, 5, "UTCTimestamp");
    int[] d = extractDateFields(f[0]);
    return new LocalDateTime(d[0], d[1], d[2], f[1], f[2], f[3], f[4]);
}

From source file:org.javarosa.core.model.utils.DateUtils.java

License:Apache License

private static LocalDateTime getLocalDateTime(DateFields f) {
    return new LocalDateTime(f.year, f.month, f.day, f.hour, f.minute, f.second, f.secTicks);
}

From source file:org.netxilia.api.utils.DateUtils.java

License:Open Source License

public static LocalDateTime toLocalDateTime(ReadablePartial partial, LocalDateTime fullDateTime) {
    if (partial instanceof LocalDateTime) {
        return (LocalDateTime) partial;
    }/*  w  w  w . j a va  2 s.  c  o m*/
    if (partial instanceof LocalDate) {
        LocalDate d = (LocalDate) partial;
        return new LocalDateTime(d.getYear(), d.getMonthOfYear(), d.getDayOfMonth(),
                fullDateTime.getHourOfDay(), fullDateTime.getMinuteOfHour(), fullDateTime.getSecondOfMinute(),
                fullDateTime.getMillisOfSecond());
    }

    if (partial instanceof LocalTime) {
        LocalTime t = (LocalTime) partial;
        return new LocalDateTime(fullDateTime.getYear(), fullDateTime.getMonthOfYear(),
                fullDateTime.getDayOfMonth(), t.getHourOfDay(), t.getMinuteOfHour(), t.getSecondOfMinute(),
                t.getMillisOfSecond());
    }

    throw new IllegalArgumentException("The partial parameter has an unsupported class:" + partial.getClass());
}

From source file:propel.core.utils.ConversionUtils.java

License:Open Source License

/**
 * Converts an XML Gregorian Calendar data type to a Joda LocalDateTime
 *//*from  w  w w  .ja  va  2 s .c o m*/
@Validate
public static LocalDateTime fromXMLGregorianCalendar(@NotNull final XMLGregorianCalendar value) {
    return new LocalDateTime(value.getYear(), value.getMonth(), value.getDay(), value.getHour(),
            value.getMinute(), value.getSecond(), value.getMillisecond());
}

From source file:uk.co.onehp.trickle.dao.HibernateSessionTokenDao.java

License:Open Source License

@Override
public SessionToken getSessionToken(SessionType sessionType) {
    @SuppressWarnings("unchecked")
    List<SessionToken> result = super.hibernateTemplate.findByNamedQueryAndNamedParam("getSessionToken",
            "sessionType", sessionType);
    if (result.size() > 0) {
        return result.get(0);
    }/*w  ww  .j ava  2  s  .  c  o m*/
    SessionToken token = new SessionToken();
    token.setSessionType(sessionType);
    token.setToken("");
    token.setUpdatedDateTime(new LocalDateTime(2011, 1, 1, 0, 0, 0, 0));
    return token;
}