06-03-2010 02:47 AM
hi,
in java, i used the following to code to set the timezone,
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); formatter.setTimeZone(TimeZone.getTimeZone("GMT-4"
String timestamp = formatter.format(new Date());
in blackberry, i followed the same way,
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT-4")
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String timestamp1 = formatter1.format(calendar.getTime());
its not working in blackberry.
Please help me in setting the timezone in blackberry
VSK
06-03-2010 06:31 AM
You code is not the same is it. BlackBerry formatter does not support setting a TimeZone.
I believe you can do something like what you want using DateFormat, but I've never done it. Search the forum, I remember seeing some other Thread which discussed this.
11-13-2012 01:35 AM
from your Calendar use a manual format, without formatter, like this:
String time = calendar.get(Calendar.HOUR_OF_DAY) + ":" +calendar.get(Calendar.MINUTE) + ":" +calendar.get(Calendar.SECOND);
formatter will reset your timezone format to default x_x
11-13-2012 03:25 AM