Java – calendar gettime() returns only est
•
Java
Calendar cl = Calendar.getInstance(TimeZone.getTimeZone("America/Los_Angeles"));
Calendar cl = Calendar.getInstance(TimeZone.getTimeZone("America/Los_Angeles")); cl.setTimeInMillis(time); Toast.makeText(getActivity(),cl.getTime().toString(),Toast.LENGTH_LONG).show();
When do I always leave it in Eastern time I hope it can return time in PST Does anyone know that this may be wrong?
Attachment: my local time is est
Solution
Try this:
TimeZone.setDefault(TimeZone.getTimeZone("PST")); Calendar cl = Calendar.getInstance();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码