Package com.contentstack.sdk.utility
Class ContentstackUtil
- java.lang.Object
-
- com.contentstack.sdk.utility.ContentstackUtil
-
public class ContentstackUtil extends Object
Used for the contentstack Utility
-
-
Method Detail
-
parseDate
public static Calendar parseDate(String date, TimeZone timeZone) throws ParseException
Converts the given date to user's timezone.- Parameters:
date- date in ISO format.timeZone- timezone selection- Returns:
Calendarobject.- Throws:
ParseException-
Example :
BuiltUtil.parseDate(dateString, TimeZone.getDefault());
-
parseDate
public static Calendar parseDate(String date, String dateFormat, TimeZone timeZone) throws ParseException
Converts the given date to the user's timezone.- Parameters:
date- date in string format.dateFormat- date format.timeZone- TimeZone.- Returns:
Calendarobject.- Throws:
ParseException-
Example :
BuiltUtil.parseDate(dateString, "yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("GMT"));
-
-