Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { private static DateFormat hourMinuteDateFormat; private static DateFormat getHourMinuteDateFormat() { if (hourMinuteDateFormat == null) { hourMinuteDateFormat = new SimpleDateFormat("HH:mm", new Locale("pt", "BR")); } return hourMinuteDateFormat; } }