|
import java.text.*; import java.util.*; public class TimeZoneFormat { #ffffff"> public static void main(String args[]) { String s; Format formatter; Date date = new Date(); formatter = new SimpleDateFormat("z"); // PST` s = formatter.format(date); System.out.println("PST Time zone format : " + s); formatter = new SimpleDateFormat("zzzz"); // Pacific Standard Time s = formatter.format(date); System.out.println("Pacific Standard Time Time zone format : " + s); formatter = new SimpleDateFormat("Z"); // -0800 s = formatter.format(date); System.out.println("Time zone format : " + s); } } |
|
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: TimeZone Format Example
Post your Comment