List of usage examples for org.joda.time LocalDateTime getSecondOfMinute
public int getSecondOfMinute()
From source file:org.jadira.usertype.dateandtime.joda.AbstractMultiColumnDateTime.java
License:Apache License
@Override protected DateTime fromConvertedColumns(Object[] convertedColumns) { LocalDateTime datePart = (LocalDateTime) convertedColumns[0]; DateTimeZone offset = (DateTimeZone) convertedColumns[1]; final DateTime result; if (datePart == null) { result = null;/* ww w. j av a 2 s . c om*/ } else { result = new DateTime(datePart.getYear(), datePart.getMonthOfYear(), datePart.getDayOfMonth(), datePart.getHourOfDay(), datePart.getMinuteOfHour(), datePart.getSecondOfMinute(), datePart.getMillisOfSecond(), offset); } return result; }
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; }//from w ww. ja va2s . 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 a Joda LocalDateTime object to an XML Gregorian Calendar data type *//*from w ww. j av a 2 s . c om*/ @Validate public static XMLGregorianCalendar toXMLGregorianCalendar(@NotNull final LocalDateTime value) throws DatatypeConfigurationException { val gc = new GregorianCalendar(value.getYear(), value.getMonthOfYear() - 1, value.getDayOfMonth(), value.getHourOfDay(), value.getMinuteOfHour(), value.getSecondOfMinute()); gc.set(Calendar.MILLISECOND, value.getMillisOfSecond()); return DatatypeFactory.newInstance().newXMLGregorianCalendar(gc); }
From source file:siddur.solidtrust.azure.AzureConnector.java
private static Date toDate(LocalDateTime l) { Calendar c = Calendar.getInstance(); c.set(Calendar.YEAR, l.getYear()); c.set(Calendar.DAY_OF_YEAR, l.getDayOfYear()); c.set(Calendar.HOUR_OF_DAY, l.getHourOfDay()); c.set(Calendar.MINUTE, l.getMinuteOfHour()); c.set(Calendar.SECOND, l.getSecondOfMinute()); c.set(Calendar.MILLISECOND, l.getMillisOfSecond()); return c.getTime(); }
From source file:uk.co.onehp.trickle.services.betfair.ScheduledServiceImpl.java
License:Open Source License
private String nextBetSchedule() { LocalDateTime nextBetTime = this.domainService.getNextBetTime(); if (null == nextBetTime) { nextBetTime = new LocalDateTime().plusMinutes(1); }/*from w ww . j av a2 s.com*/ String cron = String.format("%s %s %s %s %s ?", nextBetTime.getSecondOfMinute(), nextBetTime.getMinuteOfHour(), nextBetTime.getHourOfDay(), nextBetTime.getDayOfMonth(), nextBetTime.getMonthOfYear()); return cron; }
From source file:uk.co.onehp.trickle.services.betfair.ScheduledServiceImpl.java
License:Open Source License
private String nextBetPriceSchedule() { LocalDateTime nextBetTime = this.domainService.getNextBetTime(); if (null == nextBetTime) { nextBetTime = new LocalDateTime().plusMinutes(1); } else {/*from ww w . ja va 2 s . c om*/ nextBetTime = nextBetTime.minusSeconds(this.upcomingBetsSeconds); } String cron = String.format("%s %s %s %s %s ?", nextBetTime.getSecondOfMinute(), nextBetTime.getMinuteOfHour(), nextBetTime.getHourOfDay(), nextBetTime.getDayOfMonth(), nextBetTime.getMonthOfYear()); return cron; }