Java Doc for Date.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.Date

Date
public class Date implements Serializable,Cloneable,Comparable<Date>(Code)
Date represents a specific moment in time, to the millisecond.
See Also:   System.currentTimeMillis
See Also:   Calendar
See Also:   GregorianCalendar
See Also:   SimpleTimeZone
See Also:   TimeZone



Constructor Summary
public  Date()
     Initializes this Date instance to the current date and time.
public  Date(int year, int month, int day)
     Constructs a new Date initialized to midnight in the default TimeZone on the specified date.
public  Date(int year, int month, int day, int hour, int minute)
     Constructs a new Date initialized to the specified date and time in the default TimeZone.
public  Date(int year, int month, int day, int hour, int minute, int second)
     Constructs a new Date initialized to the specified date and time in the default TimeZone.
public  Date(long milliseconds)
     Initializes this Date instance using the specified millisecond value.
public  Date(String string)
     Constructs a new Date initialized to the date and time parsed from the specified String.

Method Summary
public static  longUTC(int year, int month, int day, int hour, int minute, int second)
     Answers the millisecond value of the specified date and time in GMT.
public  booleanafter(Date date)
     Answers if this Date is after the specified Date.
public  booleanbefore(Date date)
     Boolean indication of whether or not this Date occurs earlier than the Date argument.
public  Objectclone()
     Answers a new Date with the same millisecond value as this Date.
public  intcompareTo(Date date)
     Compare the receiver to the specified Date to determine the relative ordering.
public  booleanequals(Object object)
     Compares the specified object to this Date and answer if they are equal.
public  intgetDate()
     Answers the gregorian calendar day of the month for this Date object.
public  intgetDay()
     Answers the gregorian calendar day of the week for this Date object.
public  intgetHours()
     Answers the gregorian calendar hour of the day for this Date object.
public  intgetMinutes()
     Answers the gregorian calendar minute of the hour for this Date object.
public  intgetMonth()
     Answers the gregorian calendar month for this Date object.
public  intgetSeconds()
     Answers the gregorian calendar second of the minute for this Date object.
public  longgetTime()
     Answers this Date as a millisecond value.
public  intgetTimezoneOffset()
     Answers the timezone offset in minutes of the default TimeZone.
public  intgetYear()
     Answers the gregorian calendar year since 1900 for this Date object.
public  inthashCode()
     Answers an integer hash code for the receiver.
public static  longparse(String string)
     Answers the millisecond value of the date and time parsed from the specified String.
public  voidsetDate(int day)
     Sets the gregorian calendar day of the month for this Date object.
public  voidsetHours(int hour)
     Sets the gregorian calendar hour of the day for this Date object.
public  voidsetMinutes(int minute)
     Sets the gregorian calendar minute of the hour for this Date object.
public  voidsetMonth(int month)
     Sets the gregorian calendar month for this Date object.
public  voidsetSeconds(int second)
     Sets the gregorian calendar second of the minute for this Date object.
public  voidsetTime(long milliseconds)
     Sets this Date to the specified millisecond value.
public  voidsetYear(int year)
     Sets the gregorian calendar year since 1900 for this Date object.
public  StringtoGMTString()
    
public  StringtoLocaleString()
     Answers the string representation of this Date for the current Locale.
public  StringtoString()
    


Constructor Detail
Date
public Date()(Code)
Initializes this Date instance to the current date and time.



Date
public Date(int year, int month, int day)(Code)
Constructs a new Date initialized to midnight in the default TimeZone on the specified date.
Parameters:
  year - the year, 0 is 1900
Parameters:
  month - the month, 0 - 11
Parameters:
  day - the day of the month, 1 - 31



Date
public Date(int year, int month, int day, int hour, int minute)(Code)
Constructs a new Date initialized to the specified date and time in the default TimeZone.
Parameters:
  year - the year, 0 is 1900
Parameters:
  month - the month, 0 - 11
Parameters:
  day - the day of the month, 1 - 31
Parameters:
  hour - the hour of day, 0 - 23
Parameters:
  minute - the minute of the hour, 0 - 59



Date
public Date(int year, int month, int day, int hour, int minute, int second)(Code)
Constructs a new Date initialized to the specified date and time in the default TimeZone.
Parameters:
  year - the year, 0 is 1900
Parameters:
  month - the month, 0 - 11
Parameters:
  day - the day of the month, 1 - 31
Parameters:
  hour - the hour of day, 0 - 23
Parameters:
  minute - the minute of the hour, 0 - 59
Parameters:
  second - the second of the minute, 0 - 59



Date
public Date(long milliseconds)(Code)
Initializes this Date instance using the specified millisecond value. The value is the number of milliseconds since Jan. 1, 1970 GMT.
Parameters:
  milliseconds - the number of milliseconds since Jan. 1, 1970 GMT



Date
public Date(String string)(Code)
Constructs a new Date initialized to the date and time parsed from the specified String.
Parameters:
  string - the String to parse




Method Detail
UTC
public static long UTC(int year, int month, int day, int hour, int minute, int second)(Code)
Answers the millisecond value of the specified date and time in GMT.
Parameters:
  year - the year, 0 is 1900
Parameters:
  month - the month, 0 - 11
Parameters:
  day - the day of the month, 1 - 31
Parameters:
  hour - the hour of day, 0 - 23
Parameters:
  minute - the minute of the hour, 0 - 59
Parameters:
  second - the second of the minute, 0 - 59 long



after
public boolean after(Date date)(Code)
Answers if this Date is after the specified Date.
Parameters:
  date - a Date instance to compare true if this Date is after the specified Date, false otherwise



before
public boolean before(Date date)(Code)
Boolean indication of whether or not this Date occurs earlier than the Date argument.
Parameters:
  date - a Date instance to compare true if this Date occurs earlierthan date, otherwise false



clone
public Object clone()(Code)
Answers a new Date with the same millisecond value as this Date. a shallow copy of this Date
See Also:   java.lang.Cloneable



compareTo
public int compareTo(Date date)(Code)
Compare the receiver to the specified Date to determine the relative ordering.
Parameters:
  date - a Date an int < 0 if this Date is less than the specified Date, 0 ifthey are equal, and > 0 if this Date is greater



equals
public boolean equals(Object object)(Code)
Compares the specified object to this Date and answer if they are equal. The object must be an instance of Date and have the same millisecond value.
Parameters:
  object - the object to compare with this object true if the specified object is equal to this Date, falseotherwise
See Also:   Date.hashCode



getDate
public int getDate()(Code)
Answers the gregorian calendar day of the month for this Date object. the day of the month



getDay
public int getDay()(Code)
Answers the gregorian calendar day of the week for this Date object. the day of the week



getHours
public int getHours()(Code)
Answers the gregorian calendar hour of the day for this Date object. the hour of the day



getMinutes
public int getMinutes()(Code)
Answers the gregorian calendar minute of the hour for this Date object. the minutes



getMonth
public int getMonth()(Code)
Answers the gregorian calendar month for this Date object. the month



getSeconds
public int getSeconds()(Code)
Answers the gregorian calendar second of the minute for this Date object. the seconds



getTime
public long getTime()(Code)
Answers this Date as a millisecond value. The value is the number of milliseconds since Jan. 1, 1970 GMT. the number of milliseconds since Jan. 1, 1970 GMT.



getTimezoneOffset
public int getTimezoneOffset()(Code)
Answers the timezone offset in minutes of the default TimeZone. the timezone offset in minutes of the default TimeZone



getYear
public int getYear()(Code)
Answers the gregorian calendar year since 1900 for this Date object. the year - 1900



hashCode
public int hashCode()(Code)
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method. the receiver's hash
See Also:   Date.equals



parse
public static long parse(String string)(Code)
Answers the millisecond value of the date and time parsed from the specified String. Many date/time formats are recognized, including IETF standard syntax, i.e. Tue, 22 Jun 1999 12:16:00 GMT-0500
Parameters:
  string - the String to parse the millisecond value parsed from the String



setDate
public void setDate(int day)(Code)
Sets the gregorian calendar day of the month for this Date object.
Parameters:
  day - the day of the month



setHours
public void setHours(int hour)(Code)
Sets the gregorian calendar hour of the day for this Date object.
Parameters:
  hour - the hour of the day



setMinutes
public void setMinutes(int minute)(Code)
Sets the gregorian calendar minute of the hour for this Date object.
Parameters:
  minute - the minutes



setMonth
public void setMonth(int month)(Code)
Sets the gregorian calendar month for this Date object.
Parameters:
  month - the month



setSeconds
public void setSeconds(int second)(Code)
Sets the gregorian calendar second of the minute for this Date object.
Parameters:
  second - the seconds



setTime
public void setTime(long milliseconds)(Code)
Sets this Date to the specified millisecond value. The value is the number of milliseconds since Jan. 1, 1970 GMT.
Parameters:
  milliseconds - the number of milliseconds since Jan. 1, 1970 GMT.



setYear
public void setYear(int year)(Code)
Sets the gregorian calendar year since 1900 for this Date object.
Parameters:
  year - the year since 1900



toGMTString
public String toGMTString()(Code)
Answers the string representation of this Date in GMT in the format: 22 Jun 1999 13:02:00 GMT the string representation of this Date in GMT



toLocaleString
public String toLocaleString()(Code)
Answers the string representation of this Date for the current Locale. the string representation of this Date for the current Locale



toString
public String toString()(Code)
Answers the string representation of this Date in the format: Tue Jun 22 13:07:00 GMT 1999 the string representation of this Date



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.