By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

Date and Time

P: n/a
Rob
I'm probably not understanding this correctly but I can't seem to get the
system date and time using the calendar class.

I'm trying this:

rightNow = Calendar.getInstance();

where rightNow is an int. Not working at all. Newbie question I'm sure but I
obviously cant follow the documentation.

Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Rob" <ta******@yahoo.com> wrote in message
news:CI********************@comcast.com...
I'm probably not understanding this correctly but I can't seem to get the
system date and time using the calendar class.

I'm trying this:

rightNow = Calendar.getInstance();

where rightNow is an int. Not working at all. Newbie question I'm sure but I obviously cant follow the documentation.

Thanks


Part of you problem may be that Calendar.getInstance() returns an instance
of Calendar. Not an int.

Calendar rightNow = Calendar.getInstance();
Jul 17 '05 #2

P: n/a


You should consult the javadocs.
http://java.sun.com/j2se/1.4.1/docs/.../Calendar.html

"Rob" <ta******@yahoo.com> wrote in message
news:CI********************@comcast.com...
I'm probably not understanding this correctly but I can't seem to get the
system date and time using the calendar class.

I'm trying this:

rightNow = Calendar.getInstance();

where rightNow is an int. Not working at all. Newbie question I'm sure but I obviously cant follow the documentation.

Thanks

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.