Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

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

public class Main {
    /**
     * Convert milliseconds to "yyyy-MM-dd" format string.
     * 
     * @param milliseconds Milliseconds.
     * @return Formated string.
     */
    public final static String convertDate(long milliseconds) {
        Date date = new Date(milliseconds);
        SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd");
        return dateFormate.format(date);
    }
}