Here you can find the source of getTimeInMillisFromNicsDateString(String dateString)
public static Long getTimeInMillisFromNicsDateString(String dateString)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import org.joda.time.DateTime; public class Main { public static Long getTimeInMillisFromNicsDateString(String dateString) { Long ret = null;// ww w. j a va 2 s .co m DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); formatter.setTimeZone(TimeZone.getTimeZone("UTC")); Date date; try { date = (Date) formatter.parse(dateString); DateTime dt = new DateTime(date); ret = dt.getMillis(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return ret; } }