Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.text.DateFormat;

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

public class Main {
    public static String formatDate(Date date, String fmt, Locale locale) {
        DateFormat format = new SimpleDateFormat(fmt, locale);

        return format.format(date);
    }

    public static String formatDate(Date date, String fmt) {
        return formatDate(date, fmt, Locale.getDefault());
    }
}