Java tutorial
//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); } }