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 java.util.Locale;

public class Main {
    /**
     *
     * @param input Date for format
     * @param pattern date pattern e.g. "yyyy.MM.dd"
     * @return
     */
    public static String formateDate(Date input, String pattern) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern, new Locale("hu"));
        sdf.applyPattern(pattern);
        return sdf.format(input);
    }
}