public static String toJson(Date date) {
        if (date == null) {
            return NULL_VALUE;
        }

        CharBuf buffer = CharBuf.create(26);
        writeDate(date, buffer);

        return buffer.toString();
    }
public static String toJson ( Date date ) { if ( date == null ) { return NULL_VALUE ; } CharBuf buffer = CharBuf . create ( 26 ) ; writeDate ( date , buffer ) ; return buffer . toString ( ) ; }
Format a date that is parseable from JavaScript, according to ISO-8601.

@param date the date to format to a JSON string
@return a formatted date in the form of a string