2015-07-07T06:28:19.911Z
DateTime expirationDateTime=creationDateTime.plusMonths(3);
DateTime expirationDateTime=creationDateTime.minus(3)
if(expirationDateTime.isAfterNow()){
}
String datePattern = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
sdf.setTimeZone(TimeZone.getTimeZone("America/Denver"));
Date endDate= sdf.parse(termDto.getEndDateTime().substring(0,10));
Calendar endDateCal = Calendar.getInstance();
endDateCal.setTime(endDate);
endDateCal.add(Calendar.DAY_OF_MONTH, gracePeriod);
endDate = endDateCal.getTime();
Calendar cal = Calendar.getInstance();
//cal.setTimeZone(TimeZone.getTimeZone("America/Denver"));
cal.setTime(new Date());
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
if(stDate.compareTo(cal.getTime())<=0 && endDate.compareTo(cal.getTime())>=0){
}
DateTimeFormatter dateFormatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss'");
DateTime requestDateTime = dateFormatter.parseDateTime("timestamp");
DateFormat gmtFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
TimeZone gmtTime = TimeZone.getTimeZone("America/Denver");
gmtFormat.setTimeZone(gmtTime);
DateTime nowDate = dateFormatter.parseDateTime(gmtFormat.format(new Date()));
String datePattern = "yyyy-MM-dd'T'00:00:00";
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
sdf.setTimeZone(TimeZone.getTimeZone("America/Denver"));
String nowDate = sdf.format(new Date());
Convert joda datetime to Util date
.toDate()
Convert from java.util.date to JodaTime
ava.util.Date date = ...
DateTime dateTime = new DateTime(date);
No comments:
Post a Comment