Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

import android.annotation.SuppressLint;

public class Main {

    @SuppressLint("SimpleDateFormat")
    public static String dateFormat(String dateTime) {
        Date date = new Date(Long.parseLong(dateTime));
        SimpleDateFormat myFormat = new SimpleDateFormat("yyyy-MM-dd");
        String time = myFormat.format(date);
        return time;
    }
}