Java Doc for DateUtils.java in  » J2EE » panther » org » lateralnz » common » 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 » J2EE » panther » org.lateralnz.common.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.lateralnz.common.util.DateUtils

DateUtils
final public class DateUtils implements Constants(Code)
date formatting utilities
author:
   J R Briggs


Field Summary
public static  DateBEGINNING_OF_TIME
    
final public static  StringDAY_DATE_FORMAT
    
public static  DateEND_OF_TIME
    
final public static  StringFRI
    
final public static  StringMON
    
final public static  StringMONTH_DATE_FORMAT
    
final public static  longONE_DAY_IN_MILLISECONDS
    
final public static  StringREVERSE_DATE_FORMAT
    
final public static  StringREVERSE_DATE_TIME_FORMAT
    
final public static  StringSAT
    
final public static  StringSUN
    
final public static  StringTHURS
    
final public static  StringTUES
    
final public static  StringWED
    
final public static  StringYEAR_DATE_FORMAT
    


Method Summary
final public static  Dateadd(Date date, int field, int amount)
     add a value to a particular field (ie.
final public static  DateaddDays(Date date, int days)
    
final public static  DateapplyTime(Date d, String time)
    
final public static  StringformatDate(String callerClassName, Date d, String pattern)
    
final public static  StringformatDate(String callerClassName, Date d, Locale locale, String pattern)
    
final public static  StringgetCurrentMonthAsString()
     Get a string representation of the month+year of current date.
final public static  ListgetDateRangeList(Date start, Date end)
     get a list of date objects starting from 'start' and finishing -before- 'end'.
final public static  intgetDaysBetween(Date d1, Date d2)
    
final public static  StringgetShortDay(int dayOfWeek)
     get a string representation of a day of week (eg.
final public static  StringgetShortDay(Date date)
    
final public static  DategetStartOfWeek(Date d)
    
final public static  booleanisEqualUsingPattern(String callerClassName, Date d1, Date d2, String pattern)
    
final public static  booleanisEqualUsingPattern(String callerClassName, Date d1, Date d2, Locale locale, String pattern)
    
final public static  DateparseDate(String callerClassName, String s, String pattern)
    
final public static  DateparseDate(String callerClassName, String s, Locale locale, String pattern)
    
final public static  DatesetTime(String callerClassName, Date d, String time, String timeformat)
    

Field Detail
BEGINNING_OF_TIME
public static Date BEGINNING_OF_TIME(Code)
a constant representing the beginning of time (or 01/01/0001)



DAY_DATE_FORMAT
final public static String DAY_DATE_FORMAT(Code)
a constant format string for the day



END_OF_TIME
public static Date END_OF_TIME(Code)
a constant representing the end of time (or 31/12/9999)



FRI
final public static String FRI(Code)
a constant representing "Fri"



MON
final public static String MON(Code)
a constant representing "Mon"



MONTH_DATE_FORMAT
final public static String MONTH_DATE_FORMAT(Code)
a constant format string for the month



ONE_DAY_IN_MILLISECONDS
final public static long ONE_DAY_IN_MILLISECONDS(Code)
a constant for the number of milliseconds in a day



REVERSE_DATE_FORMAT
final public static String REVERSE_DATE_FORMAT(Code)
a constant format string for the reverse data (yyyyMMdd)



REVERSE_DATE_TIME_FORMAT
final public static String REVERSE_DATE_TIME_FORMAT(Code)
a constant format string for the date and tim (yyyyMMddhhmmss)



SAT
final public static String SAT(Code)
a constant representing "Sat"



SUN
final public static String SUN(Code)
a constant representing "Sun"



THURS
final public static String THURS(Code)
a constant representing "Thurs"



TUES
final public static String TUES(Code)
a constant representing "Tues"



WED
final public static String WED(Code)
a constant representing "Wed"



YEAR_DATE_FORMAT
final public static String YEAR_DATE_FORMAT(Code)
a constant format string for the year





Method Detail
add
final public static Date add(Date date, int field, int amount)(Code)
add a value to a particular field (ie. day, month, year) of a date. Note: if you want to subtract, then add -1, -2, etc
Parameters:
  date - the date object to add to
Parameters:
  field - the field of the date (see Calendar for fields)
Parameters:
  amount - the amount to add (or subtract if a negative number) a new date object



addDays
final public static Date addDays(Date date, int days)(Code)
add a number of days to a date (basically a wrapper call to "add")



applyTime
final public static Date applyTime(Date d, String time)(Code)
apply a string time value to a date object
Parameters:
  d - the date object to apply time to
Parameters:
  time - the time to apply as one of "hh", "hhmm" or "hhmmss"



formatDate
final public static String formatDate(String callerClassName, Date d, String pattern)(Code)
converts a date object into a string representation using a cached simpledateformat
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  d - the date to convert
Parameters:
  pattern - the date format to use



formatDate
final public static String formatDate(String callerClassName, Date d, Locale locale, String pattern)(Code)
converts a date object into a string representation using a cached simpledateformat
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  d - the date to convert
Parameters:
  locale - the locale to use in conversion
Parameters:
  pattern - the date format to use



getCurrentMonthAsString
final public static String getCurrentMonthAsString()(Code)
Get a string representation of the month+year of current date. For instance, if it's "15/07/2003", this method returns "072003".



getDateRangeList
final public static List getDateRangeList(Date start, Date end)(Code)
get a list of date objects starting from 'start' and finishing -before- 'end'. Note: start must be after end
Parameters:
  start - the date to start with
Parameters:
  end - the date to end with



getDaysBetween
final public static int getDaysBetween(Date d1, Date d2)(Code)



getShortDay
final public static String getShortDay(int dayOfWeek)(Code)
get a string representation of a day of week (eg. "Mon", "Tues", etc) a string representation of the day



getShortDay
final public static String getShortDay(Date date)(Code)
get a string representation of the day of the week the specified date represents
Parameters:
  date - the date object to use



getStartOfWeek
final public static Date getStartOfWeek(Date d)(Code)
get the first day of the week based upon the specified date (looks backwards from the date specified until it finds the monday)



isEqualUsingPattern
final public static boolean isEqualUsingPattern(String callerClassName, Date d1, Date d2, String pattern) throws ParseException(Code)
returns true if two dates are equal using a particular date pattern
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  d1 - the first date
Parameters:
  d2 - the second date
Parameters:
  pattern - the date format to compare the two date objects by



isEqualUsingPattern
final public static boolean isEqualUsingPattern(String callerClassName, Date d1, Date d2, Locale locale, String pattern) throws ParseException(Code)
returns true if two dates are equal using a particular date pattern
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  d1 - the first date
Parameters:
  d2 - the second date
Parameters:
  locale - the locale to use when comparing the dates
Parameters:
  pattern - the date format to compare the two date objects by



parseDate
final public static Date parseDate(String callerClassName, String s, String pattern) throws ParseException(Code)
turns a string representation of a date into a date object using a cached format
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  s - the string date to convert
Parameters:
  pattern - the date format to use



parseDate
final public static Date parseDate(String callerClassName, String s, Locale locale, String pattern) throws ParseException(Code)
turns a string representation of a date into a date object using a cached format
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  s - the string date to convert
Parameters:
  locale - the locale to use in conversion
Parameters:
  pattern - the date format to use



setTime
final public static Date setTime(String callerClassName, Date d, String time, String timeformat) throws ParseException(Code)
takes a date object and sets a time value against it
Parameters:
  callerClassName - the class of the object calling this method (used for caching)
Parameters:
  d - the date object to use
Parameters:
  time - the string representation of the time to set on the date object
Parameters:
  timeformat - the format of the time



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.