Package org.joda.time

Examples of org.joda.time.DateTime.toDateMidnight()


    public String getDateAndTimeString() {
        if( dateAndTimeString == null ) {
            // Build a String of format yyyy.mm.dd hh:mm:ssGMT
            final DateTime dateTime = new DateTime(getDateAndTime(), DateTimeZone.UTC);
            final DateMidnight date = dateTime.toDateMidnight();
            final TimeOfDay time = dateTime.toTimeOfDay();

            final String dateStr = DateFun.FORMAT_DATE_EXT.print(date);
            final String timeStr = DateFun.FORMAT_TIME_EXT.print(time);
View Full Code Here


        final int countStarredMessages = MessageStorage.inst().getStarredMessageCount(board);
        final int countUnreadMessages  = MessageStorage.inst().getUnreadMessageCount(board);
        final DateTime dateTime = MessageStorage.inst().getDateTimeOfLatestMessage(board);
        final String dateStr;
        if (dateTime != null) {
            final DateMidnight date = dateTime.toDateMidnight();
            dateStr = DateFun.FORMAT_DATE_EXT.print(date);
        } else {
            dateStr = "---";
        }
View Full Code Here

            DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDate());
            if (out == null) {
                return null;
            }
           
            return out.toDateMidnight();
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value));
    }
  }
}
View Full Code Here

            case VALUE_STRING:
                DateTime local = parseLocal(jp);
                if (local == null) {
                    return null;
                }
                return local.toDateMidnight();
            }
            throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
        }
    }
}
View Full Code Here

      DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDate());
      if (out == null) {
        return null;
      }
     
      return out.toDateMidnight();
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value));
    }
  }
}
View Full Code Here

          return null;     // if there is error in patient's data return age as null
        }
        Date birthdate = patient.getBirthdate();
        DateTime today = new DateTime();
        DateTime dob = new DateTime(birthdate.getTime());
        return Months.monthsBetween(dob.toDateMidnight(), today.toDateMidnight()).getMonths();
    }

/**
     *
     * @return   patient's age in days
View Full Code Here

          return null;   // if there is error in patient's data return age as null
        }
        Date birthdate = patient.getBirthdate();
        DateTime today = new DateTime();
        DateTime dob = new DateTime(birthdate.getTime());
        return Days.daysBetween(dob.toDateMidnight(), today.toDateMidnight()).getDays();
    }

    /**
    *
    * @return  concept of given id
View Full Code Here

            case VALUE_STRING:
                DateTime local = parseLocal(jp);
                if (local == null) {
                    return null;
                }
                return local.toDateMidnight();
            }
            throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array, Number or String");
        }
    }
}
View Full Code Here

                        td = timeDimensionDao.createTimeDimension(localTime);
                        times.put(localTime, td);
                    }
                   
                    //get/create DateDimension
                    final DateMidnight dateMidnight = nextDateTime.toDateMidnight();
                    DateDimension dd = dates.get(dateMidnight);
                    if (dd == null) {
                        dd = dateDimensionDao.createDateDimension(dateMidnight, 0, null);
                        dates.put(dateMidnight, dd);
                    }
View Full Code Here

    if (startDate.isAfter(currentDate))
      throw new InvalidDateException("Virtual start date cannot be after virtual current date.");
    // got from
    // http://stackoverflow.com/questions/3802893/number-of-days-between-two-dates-in-joda-time
    int diff = Days.daysBetween(startDate.toDateMidnight(),
        currentDate.toDateMidnight()).getDays();

    return diff - game.getVirtualDaysSkipped();
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.