Example usage for org.joda.time LocalTime getSecondOfMinute

List of usage examples for org.joda.time LocalTime getSecondOfMinute

Introduction

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

Prototype

public int getSecondOfMinute() 

Source Link

Document

Get the second of minute field value.

Usage

From source file:cherry.goods.util.JodaTimeUtil.java

License:Apache License

/**
 * @param ltm ???{@link LocalTime}/*w  w w  .ja  v a2  s  .com*/
 * @return ?????{@link Calendar}(?)????????(?1970-01-01)
 */
public static Calendar getCalendar(LocalTime ltm) {
    Calendar cal = Calendar.getInstance();
    cal.set(1970, 0, 1, ltm.getHourOfDay(), ltm.getMinuteOfHour(), ltm.getSecondOfMinute());
    cal.set(MILLISECOND, ltm.getMillisOfSecond());
    return cal;
}

From source file:com.alliander.osgp.domain.core.valueobjects.smartmetering.CosemTime.java

License:Open Source License

public CosemTime(final LocalTime time) {
    this(time.getHourOfDay(), time.getMinuteOfHour(), time.getSecondOfMinute(), time.getMillisOfSecond() / 10);
}

From source file:com.alliander.osgp.dto.valueobjects.smartmetering.CosemTimeDto.java

License:Open Source License

public CosemTimeDto(final LocalTime time) {
    this(time.getHourOfDay(), time.getMinuteOfHour(), time.getSecondOfMinute(), time.getMillisOfSecond() / 10);
}

From source file:com.freewheelschedule.freewheel.api.TriggerBuilder.java

License:Apache License

private String getTriggerTimeFromSource(org.freewheelschedule.freewheel.common.model.Trigger source) {
    LocalTime triggerTime = ((org.freewheelschedule.freewheel.common.model.TriggerWithTime) source)
            .getTriggerTime();/*from   w  w  w . j  a va  2s . c o m*/
    return triggerTime == null ? null
            : String.format("%2d:%02d:%02d.%03d", triggerTime.getHourOfDay(), triggerTime.getMinuteOfHour(),
                    triggerTime.getSecondOfMinute(), triggerTime.getMillisOfSecond());
}

From source file:com.helger.datetime.xml.PDTXMLConverter.java

License:Apache License

/**
 * Get the passed object as {@link XMLGregorianCalendar} time (without a
 * date)./* w  w w. j a v  a 2s . com*/
 *
 * @param aBase
 *        The source object. May be <code>null</code>.
 * @return <code>null</code> if the parameter is <code>null</code>.
 */
@Nullable
public static XMLGregorianCalendar getXMLCalendarTime(@Nullable final LocalTime aBase) {
    return aBase == null ? null
            : s_aDTFactory.newXMLGregorianCalendarTime(aBase.getHourOfDay(), aBase.getMinuteOfHour(),
                    aBase.getSecondOfMinute(), aBase.getMillisOfSecond(), DatatypeConstants.FIELD_UNDEFINED);
}

From source file:com.jseppa.mql4java.util.DateUtil.java

License:Apache License

public static DateTime addDateAndTime(LocalDate date, LocalTime time) {
    return new DateTime(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth(), time.getHourOfDay(),
            time.getMinuteOfHour(), time.getSecondOfMinute(), DATE_TZ);
}

From source file:com.planyourexchange.utils.DateUtils.java

License:Open Source License

public static Period sum(Period timeTotal, LocalTime... locatimes) {
    for (LocalTime time : locatimes) {
        timeTotal = timeTotal.plusHours(time.getHourOfDay());
        timeTotal = timeTotal.plusMinutes(time.getMinuteOfHour());
        timeTotal = timeTotal.plusSeconds(time.getSecondOfMinute());
    }//from w ww . j  ava  2  s. co  m
    return timeTotal;
}

From source file:com.sandata.lab.common.utils.date.DateUtil.java

License:Open Source License

public static Date combineDateAndTime(Date date, LocalTime time) {
    return new LocalDateTime(date.getTime()).withHourOfDay(time.getHourOfDay())
            .withMinuteOfHour(time.getMinuteOfHour()).withSecondOfMinute(time.getSecondOfMinute())
            .withMillisOfSecond(time.getMillisOfSecond()).toDate();
}

From source file:com.thirdnf.resourceScheduler.example.ConfigureTimeDialog.java

public ConfigureTimeDialog(@NotNull Frame owner, @NotNull ExampleScheduleModel model) {
    super(owner);
    initComponents();//w w w  .  j a  v  a 2s . c  o  m
    initEvents();
    LocalTime start = model.getStartTime();
    LocalTime end = model.getEndTime();
    c = Calendar.getInstance();

    c.set(Calendar.HOUR_OF_DAY, start.getHourOfDay());
    c.set(Calendar.MINUTE, start.getMinuteOfHour());
    c.set(Calendar.SECOND, start.getSecondOfMinute());
    jspHoraInicio.setValue(c.getTime());

    c.set(Calendar.HOUR_OF_DAY, end.getHourOfDay());
    c.set(Calendar.MINUTE, end.getMinuteOfHour());
    c.set(Calendar.SECOND, end.getSecondOfMinute());
    jspHoraFinal.setValue(c.getTime());
}

From source file:de.fraunhofer.iosb.ilt.sta.persistence.postgres.PgExpressionHandler.java

License:Open Source License

@Override
public Expression<?> visit(TimeConstant node) {
    LocalTime time = node.getValue();
    Calendar instance = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
    instance.set(1970, 1, 1, time.getHourOfDay(), time.getMinuteOfHour(), time.getSecondOfMinute());
    ConstantTimeExpression constant = new ConstantTimeExpression(new java.sql.Time(instance.getTimeInMillis()));
    return constant;
}