Home | History | Annotate | Download | only in email

Lines Matching refs:date

50 import java.util.Date;
222 * Returns true if the specified date is within today. Returns false otherwise.
223 * @param date
226 public static boolean isDateToday(Date date) {
228 Date today = new Date();
229 if (date.getYear() == today.getYear() &&
230 date.getMonth() == today.getMonth() &&
231 date.getDate() == today.getDate()) {
435 * Generate a time in milliseconds from a datedate/time in GMT
436 * @param DateTime date string in format 20090211T180303Z (rfc2445, iCalendar).
439 public static long parseDateTimeToMillis(String date) {
440 GregorianCalendar cal = parseDateTimeToCalendar(date);
445 * Generate a GregorianCalendar from a date string that represents a date/time in GMT
446 * @param DateTime date string in format 20090211T180303Z (rfc2445, iCalendar).
449 public static GregorianCalendar parseDateTimeToCalendar(String date) {
450 GregorianCalendar cal = new GregorianCalendar(Integer.parseInt(date.substring(0, 4)),
451 Integer.parseInt(date.substring(4, 6)) - 1, Integer.parseInt(date.substring(6, 8)),
452 Integer.parseInt(date.substring(9, 11)), Integer.parseInt(date.substring(11, 13)),
453 Integer.parseInt(date.substring(13, 15)));
459 * Generate a time in milliseconds from an email date string that represents a date/time in GMT
463 public static long parseEmailDateTimeToMillis(String date) {
464 GregorianCalendar cal = new GregorianCalendar(Integer.parseInt(date.substring(0, 4)),
465 Integer.parseInt(date.substring(5, 7)) - 1, Integer.parseInt(date.substring(8, 10)),
466 Integer.parseInt(date.substring(11, 13)), Integer.parseInt(date.substring(14, 16)),
467 Integer.parseInt(date.substring(17, 19)));