在java 中如果取得系统当前时间,精确到微秒,格式为,yyyy-MM-dd hh:mm:ss.nnnnnn
解决方案 »
- 怎么在FileReader fr=new FileReader("win.ini");里面加路径,win.ini在windows目录下。我想直接读取
- paint 可以在panel上写一个字符串吗
- JAVA优缺点之陆陆版
- 这两个程序为什么会有区别..?
- LinkedList的问题,那位帮帮忙
- 开发中遇到两个小问题,望大家能尽快帮忙
- aObject isinstance [Ljava.lang.Object; 行不行?
- 请问怎么将jpg文件转换成BOLB?
- 正在学习《java2图形设计卷1:awt〉的弟兄进来报个名呀。
- 跪求大神们,java swing 面板加载图片不能刷新 如何解决??
- javac能通过,可是java时却出现Exception in thread "main" java.lang.NoSuchMethodError:main这样
- 菜鸟请教大仙帮忙看下这个问题!!!!!!!!!!!!!!!!!!
G Era designator Text AD
y Year Year 1996; 96
Y Week year Year 2009; 09
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in year Number 189
d Day in month Number 10
F Day of week in month Number 2
E Day name in week Text Tuesday; Tue
u Day number of week (1 = Monday, ..., 7 = Sunday) Number 1
a Am/pm er Text PM
H Hour in day (0-23) Number 0
k Hour in day (1-24) Number 24
K Hour in am/pm (0-11) Number 0
h Hour in am/pm (1-12) Number 12
m Minute in hour Number 30
s Second in minute Number 55
S Millisecond Number 978
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800
X Time zone
没有 n 表达的
public static long nanoTime()
Returns the current value of the most precise available system timer, in nanoseconds. This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary time (perhaps in the future, so values may be negative). This method provides nanosecond precision, but not necessarily nanosecond accuracy. No guarantees are made about how frequently values change. Differences in successive calls that span greater than approximately 292 years (263 nanoseconds) will not accurately compute elapsed time due to numerical overflow. For example, to measure how long some code takes to execute:
long startTime = System.nanoTime();
// ... the code being measured ...
long estimatedTime = System.nanoTime() - startTime;
Returns:
The current value of the system timer, in nanoseconds.
Since:
1.5