Re: static field should be accessed in a static way
by Hendrik Maryns <gtw37bn02@[EMAIL PROTECTED]
>
Apr 16, 2008 at 11:34 AM
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig15207CBA3ADBFEB9406D828C
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
ireallyneedtoknow2007@[EMAIL PROTECTED]
schreef:
> Hi
> I need to get the current time + 15 minutes for a given time zone.
>=20
> Question: the c.get(...) show warnings such as
> "The static field Calendar.HOUR_OF_DAY should be accessed in a static
> way"
It=E2=80=99s not c.get() which is the problem, but that which is inside o=
f it.=20
In the lines above, you do it right: c.get(Calendar.YEAR)
> Calendar.getInstance(TimeZone.getTimeZone(tz)).get(Calendar.YEAR),
Good.
> String t=3Df.format(c.get(c.YEAR)) +
Bad.
HTH, H.
--=20
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
--------------enig15207CBA3ADBFEB9406D828C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFIBcg4e+7xMGD3itQRApHAAJ9WBuEpu2gKsyeUSDmJiNihLtfPPACfaoHk
Rgx6o+98H79Tl2DSvMBJYPg=
=KWfK
-----END PGP SIGNATURE-----
--------------enig15207CBA3ADBFEB9406D828C--