How to display time in different country’s format?


Levels of difficulty: / perform operation:



JAVA Program

import java.text.DateFormat;
import java.util.*;
public class Main {
	public static void main(String[] args) throws Exception {
		Date d1 = new Date();
		System.out.println("today is "+ d1.toString());
		Locale locItalian = new Locale("it","ch");
		DateFormat df = DateFormat.getDateInstance(DateFormat.FULL, locItalian);
		System.out.println("today is in Italian Language in Switzerland Format : "+ df.format(d1));
	}
}



Output

today is Mon Jun 22 02:37:06 IST 2009
today is in Italian Language in Switzerland Format : sabato, 22. febbraio 2014





Quantitative Aptitude
Reasoning
Programming
Interview