首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

[JAVA] 取得当前UTC时间

2012-12-26 
[JAVA] 获得当前UTC时间public static void getCurrentUtcTime() {??????? Date l_datetime new Date()

[JAVA] 获得当前UTC时间

public static void getCurrentUtcTime() {
??????? Date l_datetime = new Date();
??????? DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
??????? TimeZone l_timezone = TimeZone.getTimeZone("GMT-0");
??????? formatter.setTimeZone(l_timezone);
??????? String l_utc_date = formatter.format(l_datetime);
??????? System.out.println(l_utc_date + " (Local)");
}

热点排行