当前位置: 技术问答>java相关
紧急:如何得到系统时间?如何格式化double类型的数据?
来源: 互联网 发布时间:2015-08-27
本文导语: 紧急:如何得到系统时间?如何格式化double类型的数据? | java.util.Date now = new java.util.Date(); double a = now.getTime(); 其中: public long getTime() Returns the number of milliseconds since January 1, ...
紧急:如何得到系统时间?如何格式化double类型的数据?
|
java.util.Date now = new java.util.Date();
double a = now.getTime();
其中:
public long getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
Returns:
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date.
虽然是返回long,不过你可以用double变量来存储。
double a = now.getTime();
其中:
public long getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
Returns:
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date.
虽然是返回long,不过你可以用double变量来存储。
|
import java.util.Date;
Date d = new Date();
//d为系统时间
格式化double类型的数据?
不知道你是指什么
Date d = new Date();
//d为系统时间
格式化double类型的数据?
不知道你是指什么