Here you can find the source of stringToDateMetaData(String dateString)
Parameter | Description |
---|---|
dateString | the date string |
Parameter | Description |
---|---|
ParseException | the parse exception |
public static Date stringToDateMetaData(String dateString) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from www .j a va 2 s . c om * String to date meta data. * * @param dateString the date string * @return the date * @throws ParseException the parse exception */ public static Date stringToDateMetaData(String dateString) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.S"); try { return sdf.parse(dateString); } catch (NullPointerException ex) { return null; } catch (ParseException ex) { return null; } } }