Java Doc for TimeZone.java in  » Apache-Harmony-Java-SE » java-package » java » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.TimeZone

TimeZone
abstract public class TimeZone implements Serializable,Cloneable(Code)
TimeZone is an abstract class which represents a local time zone and its daylight savings time rules. Subclasses support a particular calendar type, such as the gregorian calendar. Please note the type returned by factory methods, i.e. getDefault() and getTimeZone(String), is implementation dependent, so that it may introduce serialization incompatibility issue between different implementations. Harmony returns instance of SimpleTimeZone SimpleTimeZone so that the bytes serialized by Harmony can be deserialized on other implementation successfully, but the reverse compatibility cannot be guaranteed.
See Also:   GregorianCalendar
See Also:   SimpleTimeZone


Field Summary
static  TimeZoneGMT
    
final public static  intLONG
     The LONG display name style.
final public static  intSHORT
     The SHORT display name style.

Constructor Summary
public  TimeZone()
     Constructs a new instance of this class.

Method Summary
public  Objectclone()
     Answers a new TimeZone with the same ID, rawOffset and daylight savings time rules as this TimeZone.
public static synchronized  String[]getAvailableIDs()
     Gets the available time zone IDs.
public static synchronized  String[]getAvailableIDs(int offset)
     Gets the available time zone IDs which match the specified offset from GMT.
public  intgetDSTSavings()
     Gets the daylight savings offset in milliseconds for this TimeZone.
public static synchronized  TimeZonegetDefault()
     Gets the default time zone.
final public  StringgetDisplayName()
     Gets the LONG name for this TimeZone for the default Locale in standard time.
final public  StringgetDisplayName(Locale locale)
     Gets the LONG name for this TimeZone for the specified Locale in standard time.
final public  StringgetDisplayName(boolean daylightTime, int style)
     Gets the specified style of name (LONG or SHORT) for this TimeZone for the default Locale in either standard or daylight time as specified.
public  StringgetDisplayName(boolean daylightTime, int style, Locale locale)
     Gets the specified style of name (LONG or SHORT) for this TimeZone for the specified Locale in either standard or daylight time as specified.
public  StringgetID()
     Gets the ID of this TimeZone.
public  intgetOffset(long time)
     Gets the offset from GMT of this TimeZone for the specified date.
abstract public  intgetOffset(int era, int year, int month, int day, int dayOfWeek, int time)
     Gets the offset from GMT of this TimeZone for the specified date and time.
abstract public  intgetRawOffset()
     Gets the offset for standard time from GMT for this TimeZone.
public static synchronized  TimeZonegetTimeZone(String name)
     Gets the time zone with the specified ID.
public  booleanhasSameRules(TimeZone zone)
     Answers if the specified TimeZone has the same raw offset as this TimeZone.
abstract public  booleaninDaylightTime(Date time)
     Answers if the specified Date is in the daylight savings time period for this TimeZone.
public static synchronized  voidsetDefault(TimeZone timezone)
     Sets the default time zone.
public  voidsetID(String name)
     Sets the ID of this TimeZone.
abstract public  voidsetRawOffset(int offset)
     Sets the offset for standard time from GMT for this TimeZone.
abstract public  booleanuseDaylightTime()
     Answers if this TimeZone has a daylight savings time period.

Field Detail
GMT
static TimeZone GMT(Code)



LONG
final public static int LONG(Code)
The LONG display name style.



SHORT
final public static int SHORT(Code)
The SHORT display name style.




Constructor Detail
TimeZone
public TimeZone()(Code)
Constructs a new instance of this class.




Method Detail
clone
public Object clone()(Code)
Answers a new TimeZone with the same ID, rawOffset and daylight savings time rules as this TimeZone. a shallow copy of this TimeZone
See Also:   java.lang.Cloneable



getAvailableIDs
public static synchronized String[] getAvailableIDs()(Code)
Gets the available time zone IDs. an array of time zone ID strings



getAvailableIDs
public static synchronized String[] getAvailableIDs(int offset)(Code)
Gets the available time zone IDs which match the specified offset from GMT.
Parameters:
  offset - the offset from GMT in milliseconds an array of time zone ID strings



getDSTSavings
public int getDSTSavings()(Code)
Gets the daylight savings offset in milliseconds for this TimeZone.

This implementation returns 3600000 (1 hour), or 0 if the time zone does not observe daylight savings.

Subclasses may override to return daylight savings values other than 1 hour.

the daylight savings offset in milliseconds if this TimeZoneobserves daylight savings, zero otherwise.




getDefault
public static synchronized TimeZone getDefault()(Code)
Gets the default time zone. the default time zone



getDisplayName
final public String getDisplayName()(Code)
Gets the LONG name for this TimeZone for the default Locale in standard time. If the name is not available, the result is in the format GMT[+-]hh:mm. the TimeZone name



getDisplayName
final public String getDisplayName(Locale locale)(Code)
Gets the LONG name for this TimeZone for the specified Locale in standard time. If the name is not available, the result is in the format GMT[+-]hh:mm.
Parameters:
  locale - the Locale the TimeZone name



getDisplayName
final public String getDisplayName(boolean daylightTime, int style)(Code)
Gets the specified style of name (LONG or SHORT) for this TimeZone for the default Locale in either standard or daylight time as specified. If the name is not available, the result is in the format GMT[+-]hh:mm.
Parameters:
  daylightTime - true for daylight time, false for standard time
Parameters:
  style - Either LONG or SHORT the TimeZone name



getDisplayName
public String getDisplayName(boolean daylightTime, int style, Locale locale)(Code)
Gets the specified style of name (LONG or SHORT) for this TimeZone for the specified Locale in either standard or daylight time as specified. If the name is not available, the result is in the format GMT[+-]hh:mm.
Parameters:
  daylightTime - true for daylight time, false for standard time
Parameters:
  style - Either LONG or SHORT
Parameters:
  locale - the Locale the TimeZone name



getID
public String getID()(Code)
Gets the ID of this TimeZone. the time zone ID string



getOffset
public int getOffset(long time)(Code)
Gets the offset from GMT of this TimeZone for the specified date. The offset includes daylight savings time if the specified date is within the daylight savings time period.
Parameters:
  time - the date in milliseconds since January 1, 1970 00:00:00 GMT the offset from GMT in milliseconds



getOffset
abstract public int getOffset(int era, int year, int month, int day, int dayOfWeek, int time)(Code)
Gets the offset from GMT of this TimeZone for the specified date and time. The offset includes daylight savings time if the specified date and time are within the daylight savings time period.
Parameters:
  era - the GregorianCalendar era, either GregorianCalendar.BC orGregorianCalendar.AD
Parameters:
  year - the year
Parameters:
  month - the Calendar month
Parameters:
  day - the day of the month
Parameters:
  dayOfWeek - the Calendar day of the week
Parameters:
  time - the time of day in milliseconds the offset from GMT in milliseconds



getRawOffset
abstract public int getRawOffset()(Code)
Gets the offset for standard time from GMT for this TimeZone. the offset from GMT in milliseconds



getTimeZone
public static synchronized TimeZone getTimeZone(String name)(Code)
Gets the time zone with the specified ID.
Parameters:
  name - a time zone string ID the time zone with the specified ID or null if a time zone withthe specified ID does not exist



hasSameRules
public boolean hasSameRules(TimeZone zone)(Code)
Answers if the specified TimeZone has the same raw offset as this TimeZone.
Parameters:
  zone - a TimeZone true when the TimeZones have the same raw offset, false otherwise



inDaylightTime
abstract public boolean inDaylightTime(Date time)(Code)
Answers if the specified Date is in the daylight savings time period for this TimeZone.
Parameters:
  time - a Date true when the Date is in the daylight savings time period, falseotherwise



setDefault
public static synchronized void setDefault(TimeZone timezone)(Code)
Sets the default time zone.
Parameters:
  timezone - a TimeZone object



setID
public void setID(String name)(Code)
Sets the ID of this TimeZone.
Parameters:
  name - a string which is the time zone ID



setRawOffset
abstract public void setRawOffset(int offset)(Code)
Sets the offset for standard time from GMT for this TimeZone.
Parameters:
  offset - the offset from GMT in milliseconds



useDaylightTime
abstract public boolean useDaylightTime()(Code)
Answers if this TimeZone has a daylight savings time period. true if this time zone has a daylight savings time period, falseotherwise



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.