-
What is the output of this program?
import java.text.*;
import java.util.*;
public class DateFormatting_Example
{
public static void main(String args[])
{
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("z");
System.out.print(sdf.format(d));
}
}
-
- z
- UTC
- Nov
- Tue
- None of these
Correct Option: B
format string “z” is used to print time zone.