List of usage examples for org.joda.time DateTimeConstants SECONDS_PER_DAY
int SECONDS_PER_DAY
To view the source code for org.joda.time DateTimeConstants SECONDS_PER_DAY.
Click Source Link
From source file:io.blobkeeper.cluster.service.RepairServiceImpl.java
License:Apache License
public void init() { replicationTaskExecutor.scheduleWithFixedDelay(new RepairTask(), getInitialDelaySeconds(), DateTimeConstants.SECONDS_PER_DAY, TimeUnit.SECONDS); }
From source file:org.wso2.analytics.esb.util.TimeRangeUtils.java
License:Open Source License
public static int getNoOfSecondForMonthInGivenTimestamp(long timestamp) { DateTime time = new DateTime(timestamp); return time.dayOfMonth().getMaximumValue() * DateTimeConstants.SECONDS_PER_DAY; }
From source file:uk.ac.susx.tag.method51.core.params.codec.concrete.DurationCodec.java
License:Apache License
@Override public Duration decodeString(String value) throws DecodeException { Duration result = null;//from www .jav a 2 s . c o m long milliseconds; try { milliseconds = Long.parseLong(value); } catch (NumberFormatException e) { try { if (value.length() == 0) { throw new IllegalArgumentException("zero length interval specification"); } value = value.toUpperCase(); if (!value.matches(".*[DWMHS].*")) { throw new IllegalArgumentException( "no time units specified, see ISO 8601 duration specification (months / years not supported): http://en.wikipedia.org/wiki/ISO_8601#Durations"); } if (!value.startsWith("P")) { value = "P" + value; } Matcher m = Pattern.compile("[HMS]").matcher(value); if (!value.contains("T") && m.find()) { String c = m.group(0); int i = value.indexOf(c); value = value.substring(0, i - 1) + "T" + value.substring(i - 1); } Period period = ISOPeriodFormat.standard().parsePeriod(value); long seconds = 0; seconds += period.getSeconds(); seconds += period.getMinutes() * DateTimeConstants.SECONDS_PER_MINUTE; seconds += period.getHours() * DateTimeConstants.SECONDS_PER_HOUR; seconds += period.getDays() * DateTimeConstants.SECONDS_PER_DAY; seconds += period.getWeeks() * DateTimeConstants.SECONDS_PER_WEEK; milliseconds = seconds * 1000; } catch (IllegalArgumentException e1) { throw new DecodeException("'" + value + "' is not a number, or an ISO 8601 duration", e1); } } result = new Duration(milliseconds); return result; }