Here you can find the source of parseDateWithTimezone(String dateValue)
Parameter | Description |
---|---|
dateValue | the date value |
Parameter | Description |
---|---|
ParseException | the parse exception |
public static Date parseDateWithTimezone(String dateValue) throws ParseException
//package com.java2s; /*/*w ww . j a v a 2s . co m*/ * DateUtil.java * Copyright (c) 2014, EcoFactor, All Rights Reserved. * * This software is the confidential and proprietary information of EcoFactor * ("Confidential Information"). You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you entered into with * EcoFactor. */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static final String DATE_MONTH_YEAR_FMT = "d MMMM yyyy"; /** * Parses the date with timezone. * @param dateValue the date value * @return the date * @throws ParseException the parse exception */ public static Date parseDateWithTimezone(String dateValue) throws ParseException { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_MONTH_YEAR_FMT, Locale.ENGLISH); date = sdf.parse(dateValue); return date; } }