Topic: java中怎么获得标准的北京时间?

  Print this page

1.java中怎么获得标准的北京时间? Copy to clipboard
Posted by: qy33
Posted on: 2006-10-03 18:13

Date dt = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(df.format(dt));

这样可以吗?
请问怎么获得标准的北京时间?

2.Re:java中怎么获得标准的北京时间? [Re: qy33] Copy to clipboard
Posted by: drxjava
Posted on: 2006-10-09 11:39


3.Re:java中怎么获得标准的北京时间? [Re: qy33] Copy to clipboard
Posted by: q_yuan
Posted on: 2006-10-09 16:39

你用这种方法可以得到。
String today;
Date date = new Date();
today = date.toLocaleString();


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923