Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**
     * time: 2016/10/19 11:42
     * description:
     */
    public static Date getData(String time) {
        SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
        try {
            Date parse = myFormatter.parse(time);
            return parse;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}