on 04-23-2007 4:11 PM
Hi,everybody
What is the difference beetween System.currentTimeMillis() and Date()?
Regards,
Michael
Michael,
System.currentTimeMillis() -- current date represented as number of milliseconds after/before Jan 1, 1970
java.util.Date -- object that encapsulates date, when constructor called without arguments then it's current date. Note that almost all methods of this class are deprecated while it was designed only for Grigorian calendar. To get specific day/month/year from java.util.Date use java.util.Calendar.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,Valery
Thanks for your reply.I have 1 more question.
Why if I do the following:
Date currentDate = new java.sql.Date( System.currentTimeMillis());
or
Date currentDate = new Date();
and after
int curMonth = currentDate.getMonth();
I recieve curMonth = 3 (but it is an april now)
But when I do the following:
wdContext.currentContextElement().setMonth(curDate);
I see on the screen the right current date(Month of type string in the context),
i.e. month is april.
???
Regards,
Michael
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.