List of usage examples for com.liferay.portal.kernel.util DateFormatFactoryUtil getSimpleDateFormat
public static DateFormat getSimpleDateFormat(String pattern, Locale locale, TimeZone timeZone)
From source file:com.liferay.calendarimporter.source.LotusNotesImportSource.java
License:Open Source License
protected long getTime(JSONObject eventJSON, String key) throws ParseException { DateFormat dateFormatDateTime = DateFormatFactoryUtil.getSimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US, _utcTimeZone);//from w ww .ja va 2 s . c o m JSONObject jsonObject = eventJSON.getJSONObject(key); String dateString = jsonObject.getString("date"); String timeString = jsonObject.getString("time"); Date date = (Date) dateFormatDateTime.parseObject(dateString + StringPool.SPACE + timeString); return date.getTime(); }