This is because the method 'getTimeInMillis()' is a protected method of the
Calendar class. This means that in order to access this 'protected' method
your class 'DBManager.java' must meet one of the following conditions:
1) It must be part of the 'java.util' package. or
2) It must be a subclass of 'Calendar' and be a part of the 'java.util'
package.
Since the class 'DBManager' fails both criteria, you have to try some other
way. Try this workaround:
TimeZone gmtz = TimeZone.getTimeZone("GMT");
Calendar gmtCalendar = Calendar.getInstance(gmtz);
java.util.Date gmtDate = new java.util.Date();
gmtDate = gmtCalendar.getTime(); // returns the Calendar's current time as
a Date object
long gmtTime = gmtDate.getTime();// returns the Date's current time as a
long
-----Original Message-----
From: Shawn Zhu [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 11:39 AM
To: [EMAIL PROTECTED]
Subject: Re: important ..................
How come when calling in a similar fashion to
long gmtTime = gmtCalendar.getTimeInMillis();
the compiler complains that
==============
TestCases/dataBase/DBManager.java [441:1] getTimeInMillis() has protected
access in java.util.Calendar
long tRightNow = c.getTimeInMillis();
^
1 error
> -----Original Message-----
> From: Daryani Santosh [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 15, 2001 10:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: important ..................
>
>
> Is this what you are looking for?
>
> TimeZone gmtz = TimeZone.getTimeZone("GMT");
> Calendar gmtCalendar = Calendar.getInstance(gmtz);
>
> long gmtTime = gmtCalendar.getTimeInMillis() ;
>
>
> If the time zone you want is not represented by one of the
> supported IDs, then
> you can create a custom time zone ID
> with the following syntax:
>
> GMT[+|-]hh[[:]mm]
>
>
>
> Santosh
>
>
>
>
>
>
> sandarbh <[EMAIL PROTECTED]> on 05/15/2001 12:57:20 PM
>
> Please respond to A mailing list about Java Server Pages
> specification and
> reference <[EMAIL PROTECTED]>
>
> To: [EMAIL PROTECTED]
> cc: (bcc: Santosh Daryani/IT/Aon Consulting)
>
> Subject: Re: important ..................
>
>
>
> this will give me current time in milliseconds. can we try
> getting this
> value for some other time in GMT format
>
> sandarbh
> ----- Original Message -----
> From: "Clayton Nash" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, May 15, 2001 5:19 PM
> Subject: Re: important ..................
>
>
> > just try
> > long thetime=System.currentTimeMillis();
> >
> > Clayton
> >
> > -----Original Message-----
> > From: A mailing list about Java Server Pages specification
> and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of sandarbh
> > Sent: 15 May 2001 13:49
> > To: [EMAIL PROTECTED]
> > Subject: important ..................
> >
> >
> > Hi all,
> > I have a basic simple question to ask.
> > I need to know exact difference between two times in
> milliseconds in a
> bean
> > which i am callig thru a JSP page. If i use calender class
> and use compute
> > time then it is abstract in nature so i have to blah blah
> blah........u
> know
> >
> > The other option is -->>>>>>>>>>>>>>
> > select sysdate - (select max(logdatetime) from module_log)
> from dual, get
> > the result and proceed the .. the connection is already
> there so question
> is
> > only of creating resultset and blah blah.............
> >
> > which of these options will take less system resources and why??
> >
> > Sandarbh
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST
> > DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST
> DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
This email message is for the sole use of the intended recipient(s) and may
contain proprietary and confidential information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. Thank you
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets