java.util.SimpleTimeZone.toString() java.util.SimpleTimeZone.setStartYear() java.util.SimpleTimeZone.useDaylightTime() 描述 所述toString()方法被用来获得该时区的字符串表示。 声明 以下是java.util.SimpleTimeZone.toString()方法的声明。 public String toString() 参数 NA 返回值 NA 异常 NA 实例 以下示例显示了java.util.SimpleTimeZone.toString()的用法 package com.tutorialspoint; import java.util.*; public class SimpleTimeZoneDemo { public static void main( String args[] ) { // create simple time zone object SimpleTimeZone stobj = new SimpleTimeZone(820,"US"); // get string value of time zone System.out.println("String value is : " + stobj.toString()); } } 让我们编译并运行上面的程序,这将产生以下结果。 String value is : java.util.SimpleTimeZone[id = US,offset = 820,dstSavings = 3600000, useDaylight = false,startYear = 0,startMode = 0,startMonth = 0,startDay = 0, startDayOfWeek = 0,startTime = 0,startTimeMode = 0,endMode = 0,endMonth = 0, endDay = 0,endDayOfWeek = 0,endTime = 0,endTimeMode = 0] java.util.SimpleTimeZone.setStartYear() java.util.SimpleTimeZone.useDaylightTime()