public class CalendarUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
formatDate(Calendar cal)
Formats a date in YYYY-MM-DD format.
|
static void |
formatDate(Calendar cal,
Appendable out)
Formats a date in YYYY-MM-DD format.
|
static Calendar |
getToday()
Gets today's date.
|
static Calendar |
parseDate(String yyyy_mm_dd)
Gets the date from the YYYY-MM-DD format or
null if the parameter is null. |
public static Calendar parseDate(String yyyy_mm_dd) throws IllegalArgumentException
null if the parameter is null.
Allows negative years like "-344-01-23".
Allows shorter months and days like "1976-1-9".IllegalArgumentExceptionpublic static String formatDate(Calendar cal)
null if the parameter is nullpublic static void formatDate(Calendar cal, Appendable out) throws IOException
IOExceptionpublic static Calendar getToday()
Copyright © 2016. All rights reserved.