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
-
Constructor Summary
Constructors Constructor Description ContentstackUtil()
-
Method Summary
-
Constructor Details
-
ContentstackUtil
public ContentstackUtil()
-
-
Method Details
-
parseDate
Converts the given date to user's timezone.- Parameters:
date
- date in ISO format.timeZone
- timezone selection- Returns:
Calendar
object.- Throws:
ParseException
-
Example :
BuiltUtil.parseDate(dateString, TimeZone.getDefault());
-
parseDate
public static Calendar parseDate(String date, String dateFormat, TimeZone timeZone) throws ParseExceptionConverts the given date to the user's timezone.- Parameters:
date
- date in string format.dateFormat
- date format.timeZone
- TimeZone.- Returns:
Calendar
object.- Throws:
ParseException
-
Example :
BuiltUtil.parseDate(dateString, "yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("GMT"));
-