Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
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 © 2000–2016 AO Industries, Inc.. All rights reserved.