I can get Java SE to print local TZ (PST) but I can't seem to get the same code to work on Java ME embedded. Here's the code: (be gentle - I'm a Java neophyte :-) )
import java.util.TimeZone;
import java.util.Date;
import java.util.Calendar;
public class TZTest {
public static void main(String args[]) {
TimeZone tz = Calendar.getInstance().getTimeZone();
Calendar now = Calendar.getInstance();
now.setTimeZone(tz);
System.out.println("Time and date: " + now.getTime());
}
}
When I run that code in a midlet with Java ME (minus the 'main' of course) I get:
Starting emulator in execution mode
Time and date: Fri Nov 07 14:35:38 GMT-08:00 2014
The same thing happens using my Raspberry Pi as EmbeddedExternalDevice. I tried it under Linux Ubuntu, and it prints out as PST. What is going on?
How do I get PST?
Thanks for any help. It's driving me bonkers.