Java Time Parse getTimeFromJsToJava(String date)

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

Description

get Time From Js To Java

License

Open Source License

Declaration

public static Date getTimeFromJsToJava(String date) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Date;

import java.util.Locale;

import java.util.TimeZone;

public class Main {
    public static Date getTimeFromJsToJava(String date) {

        SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.CHINA);

        utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        Date d = null;/*from w  w  w .  j  a v  a2 s.  c om*/
        try {
            d = utcFormat.parse(date);

        } catch (Exception e) {
            e.printStackTrace();
        }

        return d;
    }
}

Related

  1. getTimeFileName(String suffix)
  2. getTimeFromGermanLocale(String timeString)
  3. getTimeFromString(String time)
  4. getTimeList(String start, String end, int pitch)
  5. getTimeStr(String date1, String date2)
  6. getTimeWithStr(String source, String pattern)