Java Doc for HSSFDateUtil.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hssf » usermodel » 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 » Collaboration » poi 3.0.2 beta2 » org.apache.poi.hssf.usermodel 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.poi.hssf.usermodel.HSSFDateUtil

HSSFDateUtil
public class HSSFDateUtil (Code)
Contains methods for dealing with Excel dates.
author:
   Michael Harhen
author:
   Glen Stampoultzis (glens at apache.org)
author:
   Dan Sherman (dsherman at isisph.com)
author:
   Hack Kampbjorn (hak at 2mba.dk)
author:
   Alex Jacoby (ajacoby at gmail.com)
author:
   Pavel Krupets (pkrupets at palmtreebusiness dot com)




Method Summary
static  intabsoluteDay(Calendar cal, boolean use1904windowing)
     Given a Calendar, return the number of days since 1900/12/31.
public static  doublegetExcelDate(Date date)
     Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900.
public static  doublegetExcelDate(Date date, boolean use1904windowing)
     Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900.
public static  DategetJavaDate(double date)
     Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. NOTE: If the default TimeZone in Java uses Daylight Saving Time then the conversion back to an Excel date may not give the same value, that is the comparison excelDate == getExcelDate(getJavaDate(excelDate,false)) is not always true.
public static  DategetJavaDate(double date, boolean use1904windowing)
     Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. NOTE: If the default TimeZone in Java uses Daylight Saving Time then the conversion back to an Excel date may not give the same value, that is the comparison excelDate == getExcelDate(getJavaDate(excelDate,false)) is not always true.
public static  booleanisADateFormat(int formatIndex, String formatString)
     Given a format ID and its format String, will check to see if the format represents a date format or not.
public static  booleanisCellDateFormatted(HSSFCell cell)
     Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such.
public static  booleanisCellInternalDateFormatted(HSSFCell cell)
     Check if a cell contains a date, checking only for internal excel date formats.
public static  booleanisInternalDateFormat(int format)
     Given a format ID this will check whether the format represents an internal excel date format or not.
public static  booleanisValidExcelDate(double value)
     Given a double, checks if it is a valid Excel date.



Method Detail
absoluteDay
static int absoluteDay(Calendar cal, boolean use1904windowing)(Code)
Given a Calendar, return the number of days since 1900/12/31. days number of days since 1900/12/31
Parameters:
  cal - the Calendar
exception:
  IllegalArgumentException - if date is invalid



getExcelDate
public static double getExcelDate(Date date)(Code)
Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds. Excel representation of Date (-1 if error - test for error by checking for less than 0.1)
Parameters:
  date - the Date



getExcelDate
public static double getExcelDate(Date date, boolean use1904windowing)(Code)
Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds. Excel representation of Date (-1 if error - test for error by checking for less than 0.1)
Parameters:
  date - the Date
Parameters:
  use1904windowing - Should 1900 or 1904 date windowing be used?



getJavaDate
public static Date getJavaDate(double date)(Code)
Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. NOTE: If the default TimeZone in Java uses Daylight Saving Time then the conversion back to an Excel date may not give the same value, that is the comparison excelDate == getExcelDate(getJavaDate(excelDate,false)) is not always true. For example if default timezone is Europe/Copenhagen, on 2004-03-28 the minute after 01:59 CET is 03:00 CEST, if the excel date represents a time between 02:00 and 03:00 then it is converted to past 03:00 summer time
Parameters:
  date - The Excel date. Java representation of the date, or null if date is not a valid Excel date
See Also:   java.util.TimeZone



getJavaDate
public static Date getJavaDate(double date, boolean use1904windowing)(Code)
Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. NOTE: If the default TimeZone in Java uses Daylight Saving Time then the conversion back to an Excel date may not give the same value, that is the comparison excelDate == getExcelDate(getJavaDate(excelDate,false)) is not always true. For example if default timezone is Europe/Copenhagen, on 2004-03-28 the minute after 01:59 CET is 03:00 CEST, if the excel date represents a time between 02:00 and 03:00 then it is converted to past 03:00 summer time
Parameters:
  date - The Excel date.
Parameters:
  use1904windowing - true if date uses 1904 windowing,or false if using 1900 date windowing. Java representation of the date, or null if date is not a valid Excel date
See Also:   java.util.TimeZone



isADateFormat
public static boolean isADateFormat(int formatIndex, String formatString)(Code)
Given a format ID and its format String, will check to see if the format represents a date format or not. Firstly, it will check to see if the format ID corresponds to an internal excel date format (eg most US date formats) If not, it will check to see if the format string only contains date formatting characters (ymd-/), which covers most non US date formats.
Parameters:
  formatIndex - The index of the format, eg from ExtendedFormatRecord.getFormatIndex
Parameters:
  formatString - The format string, eg from FormatRecord.getFormatString
See Also:   HSSFDateUtil.isInternalDateFormat(int)



isCellDateFormatted
public static boolean isCellDateFormatted(HSSFCell cell)(Code)
Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such.
See Also:   HSSFDateUtil.isADateFormat(int,String)
See Also:   HSSFDateUtil.isInternalDateFormat(int)



isCellInternalDateFormatted
public static boolean isCellInternalDateFormatted(HSSFCell cell)(Code)
Check if a cell contains a date, checking only for internal excel date formats. As Excel stores a great many of its dates in "non-internal" date formats, you will not normally want to use this method.
See Also:   HSSFDateUtil.isADateFormat(int,String)
See Also:   HSSFDateUtil.isInternalDateFormat(int)



isInternalDateFormat
public static boolean isInternalDateFormat(int format)(Code)
Given a format ID this will check whether the format represents an internal excel date format or not.
See Also:   HSSFDateUtil.isADateFormat(int,java.lang.String)
See Also:   



isValidExcelDate
public static boolean isValidExcelDate(double value)(Code)
Given a double, checks if it is a valid Excel date. true if valid
Parameters:
  value - the double value



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.