[英]Java Date output is wrong. Why?
I'am playing with Java Date and can't understand this: 我在玩Java Date,无法理解:
Date myBirth = new Date(1991,01,21);
Log.d("DATE: ", "" + myBirth);
Here I initialized Date object. 在这里,我初始化了Date对象。 Why I get this output?
为什么得到此输出?
DEBUG/DATE:(31693): Sat Feb 21 00:00:00 EET 3891
Quoting from the Javadoc of this deprecated constructor of Date: 从Javadoc中引用以下不推荐使用的Date构造函数:
Parameters:
year - the year **minus 1900**.
month - the month between 0-11.
date - the day of the month between 1-31.
So the output is what you ask, but not what you want. 所以输出就是您要的,而不是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.