Java Doc for HsqlDateTime.java in  » Database-DBMS » hsql » org » hsqldb » 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 » Database DBMS » hsql » org.hsqldb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.HsqlDateTime

HsqlDateTime
public class HsqlDateTime (Code)
collection of static methods to convert Date, Time and Timestamp strings into corresponding Java objects. Also accepts SQL literals such as NOW, TODAY as valid strings and returns the current date / time / datetime. Compatible with jdk 1.1.x.

Was reviewed for 1.7.2 resulting in centralising all DATETIME related operstions.

HSQLDB uses the client and server's default timezone for all DATETIME operations. It stores the DATETIME values in .log and .script files using the default locale of the server. The same values are stored as binary UTC timestamps in .data files. If the database is trasported from one timezone to another, then the DATETIME values in cached tables will be handled as UTC but those in other tables will be treated as local. So a timestamp representing 12 noon stored in Tokyo timezone will be treated as 9 pm in London when stored in a cached table but the same value stored in a memory table will be treated as 12 noon.
author:
   fredt@users
version:
   1.7.2
since:
   1.7.0


Inner Class :static class Tokenizer

Field Summary
final public static  chare
    
static  SimpleDateFormatsdfd
    
static  SimpleDateFormatsdft
    
static  SimpleDateFormatsdfts
    
static  SimpleDateFormatsdftsSys
    
final static  Stringzerodatetime
    
final static  Stringzeronanos
    


Method Summary
static  intcompare(Date a, Date b)
    
static  intcompare(Time a, Time b)
    
static  intcompare(Timestamp a, Timestamp b)
    
public static  DatedateValue(String s)
     Converts a string in JDBC date escape format to a Date value.
public static synchronized  DategetCurrentDate(long millis)
    
public static  StringgetDateString(java.util.Date x, Calendar cal)
    
static  intgetDateTimePart(java.util.Date d, int part)
     Returns the indicated part of the given java.util.Date object.
public static  longgetNormalisedDate(long d)
    
public static  DategetNormalisedDate(Timestamp ts)
    
public static  DategetNormalisedDate(Date d)
    
public static  longgetNormalisedTime(long t)
    
public static  TimegetNormalisedTime(Time t)
    
public static  TimegetNormalisedTime(Timestamp ts)
    
public static  TimestampgetNormalisedTimestamp(Time t)
    
public static  TimestampgetNormalisedTimestamp(Date d)
    
public static  StringgetSytemTimeString()
    
public static  longgetTimeInMillis(java.util.Date dt, Calendar source, Calendar target)
    
public static  longgetTimeInMillis(Calendar cal)
     Gets the time from the given Calendar as a milliseconds value; wrapper method to allow use of more efficient JDK1.4 method on JDK1.4 (was protected in earlier versions).
public static  StringgetTimeString(java.util.Date x, Calendar cal)
    
public static  TimestampgetTimestamp(long millis)
    
public static  StringgetTimestampString(Timestamp x)
    
public static  StringgetTimestampString(Timestamp x, Calendar cal)
    
public static  StringgetTimestampString(long timestamp)
    
static synchronized  CalendargetToday(long millis)
     Returns the same Date Object.
public static  voidresetToDate(Calendar cal)
    
public static  voidresetToTime(Calendar cal)
    
public static  TimestampsimpleTimestampValue(String s)
    
public static  TimetimeValue(String s)
     Converts a string in JDBC date escape format to a Time value.
public static  TimestamptimestampValue(String s)
     Converts a string in JDBC timestamp escape format to a Timestamp value.
public static  TimestamptimestampValue(long time, int nano)
    
public static  StringtoJavaDatePattern(String format)
    

Field Detail
e
final public static char e(Code)
Indicates end-of-input



sdfd
static SimpleDateFormat sdfd(Code)



sdft
static SimpleDateFormat sdft(Code)



sdfts
static SimpleDateFormat sdfts(Code)



sdftsSys
static SimpleDateFormat sdftsSys(Code)



zerodatetime
final static String zerodatetime(Code)



zeronanos
final static String zeronanos(Code)





Method Detail
compare
static int compare(Date a, Date b)(Code)



compare
static int compare(Time a, Time b)(Code)



compare
static int compare(Timestamp a, Timestamp b)(Code)



dateValue
public static Date dateValue(String s) throws HsqlException(Code)
Converts a string in JDBC date escape format to a Date value. Also accepts Timestamp values.
Parameters:
  s - date in format yyyy-mm-dd, corresponding Date value
exception:
  java.lang.IllegalArgumentException - if the given argumentdoes not have the format yyyy-mm-dd



getCurrentDate
public static synchronized Date getCurrentDate(long millis)(Code)



getDateString
public static String getDateString(java.util.Date x, Calendar cal)(Code)



getDateTimePart
static int getDateTimePart(java.util.Date d, int part)(Code)
Returns the indicated part of the given java.util.Date object.
Parameters:
  d - the Date object from which to extract the indicated part
Parameters:
  part - an integer code corresponding to the desired date part the indicated part of the given java.util.Date object



getNormalisedDate
public static long getNormalisedDate(long d)(Code)



getNormalisedDate
public static Date getNormalisedDate(Timestamp ts)(Code)



getNormalisedDate
public static Date getNormalisedDate(Date d)(Code)



getNormalisedTime
public static long getNormalisedTime(long t)(Code)



getNormalisedTime
public static Time getNormalisedTime(Time t)(Code)



getNormalisedTime
public static Time getNormalisedTime(Timestamp ts)(Code)



getNormalisedTimestamp
public static Timestamp getNormalisedTimestamp(Time t)(Code)



getNormalisedTimestamp
public static Timestamp getNormalisedTimestamp(Date d)(Code)



getSytemTimeString
public static String getSytemTimeString()(Code)



getTimeInMillis
public static long getTimeInMillis(java.util.Date dt, Calendar source, Calendar target)(Code)



getTimeInMillis
public static long getTimeInMillis(Calendar cal)(Code)
Gets the time from the given Calendar as a milliseconds value; wrapper method to allow use of more efficient JDK1.4 method on JDK1.4 (was protected in earlier versions).
Parameters:
  cal - the Calendar the time value in milliseconds



getTimeString
public static String getTimeString(java.util.Date x, Calendar cal)(Code)



getTimestamp
public static Timestamp getTimestamp(long millis)(Code)



getTimestampString
public static String getTimestampString(Timestamp x)(Code)
Creates a valid timestamp string - jre 1.3 returns incorrect date part for Timestamp.toString();



getTimestampString
public static String getTimestampString(Timestamp x, Calendar cal)(Code)
Creates a full length timestamp string, with 9 digist for nanos



getTimestampString
public static String getTimestampString(long timestamp)(Code)



getToday
static synchronized Calendar getToday(long millis)(Code)
Returns the same Date Object. This object should be treated as read-only.



resetToDate
public static void resetToDate(Calendar cal)(Code)



resetToTime
public static void resetToTime(Calendar cal)(Code)



simpleTimestampValue
public static Timestamp simpleTimestampValue(String s)(Code)
For use with .script file, simpler than above



timeValue
public static Time timeValue(String s)(Code)
Converts a string in JDBC date escape format to a Time value.
Parameters:
  s - date in format hh:mm:ss corresponding Time value
exception:
  java.lang.IllegalArgumentException - if the given argumentdoes not have the format hh:mm:ss



timestampValue
public static Timestamp timestampValue(String s) throws HsqlException(Code)
Converts a string in JDBC timestamp escape format to a Timestamp value.
Parameters:
  s - timestamp in format yyyy-mm-dd hh:mm:ss.fffffffffwhere end part can be omitted, or "NOW" (case insensitive) corresponding Timestamp value
exception:
  java.lang.IllegalArgumentException - if the given argumentdoes not have the format yyyy-mm-dd hh:mm:ss.fffffffff



timestampValue
public static Timestamp timestampValue(long time, int nano)(Code)

Parameters:
  time - milliseconds
Parameters:
  nano - nanoseconds Timestamp object



toJavaDatePattern
public static String toJavaDatePattern(String format)(Code)
Converts the given format into a pattern accepted by java.text.SimpleDataFormat
Parameters:
  format -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) 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.