Java Doc for Timestamp.java in  » Apache-Harmony-Java-SE » java-package » java » sql » 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.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.Date
      java.sql.Date
         java.sql.Timestamp

Timestamp
public class Timestamp extends Date (Code)
A Java representation of the SQL TIMESTAMP type. It provides the capability to represent the SQL TIMESTAMP nanosecond value, in addition to the regular date/time value which has millisecond resolution.

The Timestamp class consists of a regular Date/Time value, where only the integral seconds value is stored, plus a nanoseconds value where the fractional seconds are stored.

The addition of the nanosecond value field to the Timestamp object makes it significantly different from the java.util.Date object which it extends. Users should be cautious in their use of Timestamp objects and should not assume that they are interchangeable with java.util.Date objects when used outside the confines of the java.sql package.




Constructor Summary
public  Timestamp(int theYear, int theMonth, int theDate, int theHour, int theMinute, int theSecond, int theNano)
    
public  Timestamp(long theTime)
     Returns a Timestamp object corresponding to the time represented by a supplied time value.

Method Summary
public  booleanafter(Timestamp theTimestamp)
     Returns true if this timestamp object is later than the supplied timestamp, otherwise returns false.
public  booleanbefore(Timestamp theTimestamp)
     Returns true if this timestamp object is earlier than the supplied timestamp, otherwise returns false.
public  intcompareTo(Date theObject)
    
public  intcompareTo(Timestamp theTimestamp)
    
public  booleanequals(Object theObject)
     Tests to see if this timestamp is equal to a supplied object.
public  booleanequals(Timestamp theTimestamp)
     Tests to see if this timestamp is equal to a supplied timestamp.
public  intgetNanos()
    
public  longgetTime()
    
public  voidsetNanos(int n)
    
public  voidsetTime(long theTime)
    
public  StringtoString()
    
public static  TimestampvalueOf(String s)
    


Constructor Detail
Timestamp
public Timestamp(int theYear, int theMonth, int theDate, int theHour, int theMinute, int theSecond, int theNano) throws IllegalArgumentException(Code)

Parameters:
  theYear - specified as the year minus 1900
Parameters:
  theMonth - specified as an integer in the range 0 - 11
Parameters:
  theDate - specified as an integer in the range 1 - 31
Parameters:
  theHour - specified as an integer in the range 0 - 23
Parameters:
  theMinute - specified as an integer in the range 0 - 59
Parameters:
  theSecond - specified as an integer in the range 0 - 59
Parameters:
  theNano - which defines the nanosecond value of the timestamp specifiedas an integer in the range 0 - 999,999,999
throws:
  IllegalArgumentException - if any of the parameters is out of range



Timestamp
public Timestamp(long theTime)(Code)
Returns a Timestamp object corresponding to the time represented by a supplied time value.
Parameters:
  theTime - a time value in the format of milliseconds since the Epoch(January 1 1970 00:00:00.000 GMT)




Method Detail
after
public boolean after(Timestamp theTimestamp)(Code)
Returns true if this timestamp object is later than the supplied timestamp, otherwise returns false.
Parameters:
  theTimestamp - the timestamp to compare with this timestamp object true if this timestamp object is later than the suppliedtimestamp, false otherwise



before
public boolean before(Timestamp theTimestamp)(Code)
Returns true if this timestamp object is earlier than the supplied timestamp, otherwise returns false.
Parameters:
  theTimestamp - the timestamp to compare with this timestamp object true if this timestamp object is earlier than the suppliedtimestamp, false otherwise



compareTo
public int compareTo(Date theObject) throws ClassCastException(Code)
Compares this Timestamp object with a supplied Timestamp object
Parameters:
  theObject - the timestamp to compare with this timestamp object, passed inas an Object 0 if the two Timestamp objects are equal in time, a value <0 ifthis Timestamp object is before the supplied Timestamp and avalue >0 if this Timestamp object is after the supplied Timestamp
throws:
  ClassCastException - if the supplied object is not a Timestamp object



compareTo
public int compareTo(Timestamp theTimestamp)(Code)
Compares this Timestamp object with a supplied Timestamp object
Parameters:
  theTimestamp - the timestamp to compare with this timestamp object, passed inas a Timestamp 0 if the two Timestamp objects are equal in time, a value <0 ifthis Timestamp object is before the supplied Timestamp and avalue >0 if this Timestamp object is after the supplied Timestamp



equals
public boolean equals(Object theObject)(Code)
Tests to see if this timestamp is equal to a supplied object.
Parameters:
  theObject - true if this Timestamp object is equal to the supplied Timestampobject false if the object is not a Timestamp object or if theobject is a Timestamp but represents a different instant in time



equals
public boolean equals(Timestamp theTimestamp)(Code)
Tests to see if this timestamp is equal to a supplied timestamp.
Parameters:
  theTimestamp - the timestamp to compare with this timestamp object, passed inas an Object true if this Timestamp object is equal to the supplied Timestampobject



getNanos
public int getNanos()(Code)
Gets this Timestamp's nanosecond value The timestamp's nanosecond value, an integer between 0 and999,999,999



getTime
public long getTime()(Code)
Returns the time represented by this Timestamp object, as a long value containing the number of milliseconds since the Epoch (January 1 1970, 00:00:00.000 GMT)



setNanos
public void setNanos(int n) throws IllegalArgumentException(Code)
Sets the nanosecond value for this timestamp



setTime
public void setTime(long theTime)(Code)
Sets the time represented by this Timestamp object to the supplied time, defined as the number of milliseconds since the Epoch (January 1 1970, 00:00:00.000 GMT)



toString
public String toString()(Code)
Returns the timestamp formatted as a String in the JDBC Timestamp Escape format, which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn" A string representing the instant defined by the Timestamp, inJDBC Timestamp escape format



valueOf
public static Timestamp valueOf(String s) throws IllegalArgumentException(Code)
Creates a Timestamp object with a time value equal to the time specified by a supplied String holding the time in JDBC timestamp escape format, which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn"
Parameters:
  s - the String containing a time in JDBC timestamp escape format A timestamp object with time value as defined by the suppliedString



Methods inherited from java.sql.Date
public int getHours()(Code)(Java Doc)
public int getMinutes()(Code)(Java Doc)
public int getSeconds()(Code)(Java Doc)
public void setHours(int theHours)(Code)(Java Doc)
public void setMinutes(int theMinutes)(Code)(Java Doc)
public void setSeconds(int theSeconds)(Code)(Java Doc)
public void setTime(long theTime)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static Date valueOf(String dateString)(Code)(Java Doc)

Methods inherited from java.util.Date
public static long UTC(int year, int month, int day, int hour, int minute, int second)(Code)(Java Doc)
public boolean after(Date date)(Code)(Java Doc)
public boolean before(Date date)(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int compareTo(Date date)(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
public int getDate()(Code)(Java Doc)
public int getDay()(Code)(Java Doc)
public int getHours()(Code)(Java Doc)
public int getMinutes()(Code)(Java Doc)
public int getMonth()(Code)(Java Doc)
public int getSeconds()(Code)(Java Doc)
public long getTime()(Code)(Java Doc)
public int getTimezoneOffset()(Code)(Java Doc)
public int getYear()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public static long parse(String string)(Code)(Java Doc)
public void setDate(int day)(Code)(Java Doc)
public void setHours(int hour)(Code)(Java Doc)
public void setMinutes(int minute)(Code)(Java Doc)
public void setMonth(int month)(Code)(Java Doc)
public void setSeconds(int second)(Code)(Java Doc)
public void setTime(long milliseconds)(Code)(Java Doc)
public void setYear(int year)(Code)(Java Doc)
public String toGMTString()(Code)(Java Doc)
public String toLocaleString()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.