java.lang.Object
com.aoapps.lang.util.CalendarUtils
Deprecated.
Calendar utilities.
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.Please usejava.timeavailable since Java SE 8. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDate(Calendar cal) Deprecated.Please useLocalDate.toString()available since Java SE 8.static voidformatDate(Calendar cal, Appendable out) Deprecated.Please useLocalDate.toString()available since Java SE 8.static StringformatDateTime(Calendar cal) Deprecated.Please useLocalDateTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.static voidformatDateTime(Calendar cal, Appendable out) Deprecated.Please useLocalDateTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.static StringformatTime(Calendar cal) Deprecated.Please useLocalTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.static voidformatTime(Calendar cal, Appendable out) Deprecated.Please useLocalTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.static GregorianCalendargetToday()Deprecated.Please useLocalDate.now()available since Java SE 8.static GregorianCalendarDeprecated.Please useLocalDate.now(java.time.ZoneId)available since Java SE 8.static GregorianCalendarDeprecated.Please useLocalDate.parse(java.lang.CharSequence)available since Java SE 8.static GregorianCalendarDeprecated.Please useLocalDate.parse(java.lang.CharSequence)available since Java SE 8.static GregorianCalendarparseDateTime(String dateTime) Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.static GregorianCalendarparseDateTime(String dateTime, TimeZone timeZone) Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.static <T> TparseDateTime(String dateTime, TimeZone timeZone, CalendarUtils.DateTimeProducer<T> producer) Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.
-
Method Details
-
formatDate
Deprecated.Please useLocalDate.toString()available since Java SE 8.Formats a date in "YYYY-MM-DD" format.- Returns:
- the formatted date or
nullif the parameter isnull
-
formatDate
@Deprecated(forRemoval=false) public static void formatDate(Calendar cal, Appendable out) throws IOException Deprecated.Please useLocalDate.toString()available since Java SE 8.Formats a date in "YYYY-MM-DD" format.- Throws:
IOException
-
parseDate
@Deprecated(forRemoval=false) public static GregorianCalendar parseDate(String yyyy_mm_dd, TimeZone timeZone) throws IllegalArgumentException Deprecated.Please useLocalDate.parse(java.lang.CharSequence)available since Java SE 8.Gets the date from the "YYYY-MM-DD" format in the given time zone ornullif the parameter isnull. Allows negative years like "-344-01-23". Allows shorter months and days like "1976-1-9".- Parameters:
yyyy_mm_dd- The date in YYYY-MM-DD format.timeZone- The time zone to use ornullto use the default time zone- Throws:
IllegalArgumentException
-
parseDate
@Deprecated(forRemoval=false) public static GregorianCalendar parseDate(String yyyy_mm_dd) throws IllegalArgumentException Deprecated.Please useLocalDate.parse(java.lang.CharSequence)available since Java SE 8.Gets the date from the "YYYY-MM-DD" format in the default time zone ornullif the parameter isnull. Allows negative years like "-344-01-23". Allows shorter months and days like "1976-1-9".- Parameters:
yyyy_mm_dd- The date in YYYY-MM-DD format.- Throws:
IllegalArgumentException
-
formatTime
Deprecated.Please useLocalTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.Formats a time in "HH:MM:SS" format.- Returns:
- the formatted time or
nullif the parameter isnull
-
formatTime
@Deprecated(forRemoval=false) public static void formatTime(Calendar cal, Appendable out) throws IOException Deprecated.Please useLocalTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.Formats a time in "HH:MM:SS" format.- Throws:
IOException
-
formatDateTime
Deprecated.Please useLocalDateTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.Formats a date and time in "YYYY-MM-DD HH:MM:SS" format.- Returns:
- the formatted date and time or
nullif the parameter isnull
-
formatDateTime
@Deprecated(forRemoval=false) public static void formatDateTime(Calendar cal, Appendable out) throws IOException Deprecated.Please useLocalDateTime.format(java.time.format.DateTimeFormatter)available since Java SE 8.Formats a date and time in "YYYY-MM-DD HH:MM:SS" format.- Throws:
IOException
-
parseDateTime
@Deprecated(forRemoval=false) public static <T> T parseDateTime(String dateTime, TimeZone timeZone, CalendarUtils.DateTimeProducer<T> producer) throws IllegalArgumentException Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.Gets the date and time from the "YYYY-MM-DD[ HH:MM[:SS[.nnnnnnnnn]]]" format in the given time zone ornullif the parameter isnull. Allows negative years like "-344-01-23". Allows shorter months, days, hours, minutes, and millis like "1976-1-9 1:2:3.1".- Parameters:
timeZone- The time zone to use ornullto use the default time zone- Throws:
IllegalArgumentException
-
parseDateTime
@Deprecated(forRemoval=false) public static GregorianCalendar parseDateTime(String dateTime, TimeZone timeZone) throws IllegalArgumentException Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.Gets the date and time from the "YYYY-MM-DD[ HH:MM[:SS[.mmm]]]" format in the given time zone ornullif the parameter isnull. Allows negative years like "-344-01-23". Allows shorter months, days, hours, minutes, and millis like "1976-1-9 1:2:3.1".- Parameters:
timeZone- The time zone to use ornullto use the default time zone- Throws:
IllegalArgumentException
-
parseDateTime
@Deprecated(forRemoval=false) public static GregorianCalendar parseDateTime(String dateTime) throws IllegalArgumentException Deprecated.Please useLocalDateTime.parse(java.lang.CharSequence, java.time.format.DateTimeFormatter)available since Java SE 8.Gets the date and time from the "YYYY-MM-DD[ HH:MM[:SS[.mmm]]]" format in the default time zone ornullif the parameter isnull. Allows negative years like "-344-01-23". Allows shorter months, days, hours, minutes, and millis like "1976-1-9 1:2:3.1".- Throws:
IllegalArgumentException
-
getToday
Deprecated.Please useLocalDate.now(java.time.ZoneId)available since Java SE 8.Gets today's date in the given time zone. Hour, minute, second, and millisecond are all set to zero.- Parameters:
timeZone- The time zone to use ornullto use the default time zone
-
getToday
Deprecated.Please useLocalDate.now()available since Java SE 8.Gets today's date in the default time zone. Hour, minute, second, and millisecond are all set to zero.
-

java.timeavailable since Java SE 8.