Android: Convert from PST TimeZone to our local TimeZone
I have a time in PST TimeZone (06:00 PM PST). How can I convert this time to my TimeZone?
I tried with some code, but i can not find a method to convert the time zone.
import java.util.TimeZone;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// my local time zone
TimeZone mytimezone= TimeZone.getDefault();
String timezonename=mytimezone.getID();
String myname=mytimezone.getDis开发者_如何学编程playName();
//this is for PST
TimeZone timezone=TimeZone.getTimeZone("PST");
String timezonename= timezone.getDisplayName(); //GMT+00:00
}
Please help me...
Thank you...
Check the 1st answer here:
How to handle calendar TimeZones using Java?
精彩评论