Android Date String Parse stringToDate(String date)

Here you can find the source of stringToDate(String date)

Description

string To Date

License

Apache License

Declaration

public static Date stringToDate(String date) throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    private static SimpleDateFormat formatter = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm:ss");

    public static Date stringToDate(String date) throws ParseException {
        formatter.setTimeZone(TimeZone.getTimeZone("gmt"));
        return (formatter.parse(date));
    }/* ww  w. j  ava 2  s . c  o m*/
}

Related

  1. parse(String source, String pattern)
  2. parseDate(String value, String[] parsePatterns)
  3. parseJsonDate(String jsonDate)
  4. str2Date(String str)
  5. stringConvertDate(String date)
  6. toDate(String string)
  7. tokenizeDate(String date)
  8. String2Date(String dateStr)
  9. changeDateWithSplit(String argDate, String split)