TimeZoneTest.java
资源名称:J2ME&Game.rar [点击查看]
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:
J2ME
开发平台:
Java
- import java.util.TimeZone;
- import javax.microedition.midlet.MIDlet;
- public class TimeZoneTest extends MIDlet
- {
- public TimeZoneTest() {
- TimeZone currentTZ = TimeZone.getDefault();
- System.out.println("默认时区是:"+currentTZ.getID());
- System.out.println("可用时区是:");
- String[] timezoneID = TimeZone.getAvailableIDs();
- for(int i = 0; i<timezoneID.length;i++){
- System.out.println("t"+timezoneID[i]);
- }
- currentTZ = TimeZone.getTimeZone(timezoneID[0]);
- System.out.println("新的时区是:"+currentTZ.getID());
- }
- protected void startApp() {
- }
- protected void destroyApp(boolean unconditional) {
- }
- protected void pauseApp() {
- }
- }