Java Doc for TimeUtil.java in  » Development » jodd » jodd » datetime » 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 » Development » jodd » jodd.datetime 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jodd.datetime.TimeUtil

TimeUtil
public class TimeUtil (Code)
Date time calculations and utilities. TimeUtil is used by JDateTime and it contains few utilities that may be used elswhere, although JDateTime is recomended for all time manipulation.


Field Summary
final public static  longMILLIS_IN_DAY
    


Method Summary
public static  intdayOfYear(int year, int month, int day)
     Calculates day of year from given time stamp.
public static  DateTimeStampfromJulianDate(double JD)
     Calculates time stamp from Astronomical Julian Date.
public static  DateTimeStampfromJulianDate(JulianDateStamp jds)
     Calculates time stamp from Astronomical Julian Date.
public static  intgetMonthLength(int year, int m)
     Returns the length of the specified month in days.
public static  booleanisLeapYear(int y)
     Check if the given year is leap year.
public static  booleanisValidDate(int year, int month, int day)
     Checks if date is valid.
public static  booleanisValidDateTime(int year, int month, int day, int hour, int minute, double second)
     Checks if date and time are valid.
public static  booleanisValidDateTime(DateTimeStamp dts)
     Checks if date and time are valid.
public static  booleanisValidTime(int hour, int minute, double second)
     Checks if time is valid.
public static  JulianDateStamptoJulianDate(DateTimeStamp time)
     Calculates Astronomical Julian Date from given time stamp.
public static  JulianDateStamptoJulianDate(int year, int month, int day, int hour, int minute, double second)
     Calculates Astronomical Julian Date from given time.

Astronomical Julian Dates are counting from noon of the January 1st, -4712 (julian date 0 is -4712/01/01 12:00:00).


Field Detail
MILLIS_IN_DAY
final public static long MILLIS_IN_DAY(Code)





Method Detail
dayOfYear
public static int dayOfYear(int year, int month, int day)(Code)
Calculates day of year from given time stamp. It may not work for some dates in 1582. day of year in range: [1-366]



fromJulianDate
public static DateTimeStamp fromJulianDate(double JD)(Code)
Calculates time stamp from Astronomical Julian Date.
Parameters:
  JD - julian date time stamp



fromJulianDate
public static DateTimeStamp fromJulianDate(JulianDateStamp jds)(Code)
Calculates time stamp from Astronomical Julian Date. Algorithm based on Numerical Recipesin C, 2nd ed., Cambridge University Press 1992.
Parameters:
  jds - julian date stamp time stamp



getMonthLength
public static int getMonthLength(int year, int m)(Code)
Returns the length of the specified month in days. Month is 1 for January and 12 for December. length of the specified month in days



isLeapYear
public static boolean isLeapYear(int y)(Code)
Check if the given year is leap year. true if the year is a leap year



isValidDate
public static boolean isValidDate(int year, int month, int day)(Code)
Checks if date is valid. true if date is valid, otherwise false



isValidDateTime
public static boolean isValidDateTime(int year, int month, int day, int hour, int minute, double second)(Code)
Checks if date and time are valid.
Parameters:
  year - year to check
Parameters:
  month - month to check
Parameters:
  day - day to check
Parameters:
  hour - hour to check
Parameters:
  minute - minute to check
Parameters:
  second - second to check true if date and time are valid, otherwise false



isValidDateTime
public static boolean isValidDateTime(DateTimeStamp dts)(Code)
Checks if date and time are valid.
Parameters:
  dts - date/time stamp true if date and time are valid, otherwise false



isValidTime
public static boolean isValidTime(int hour, int minute, double second)(Code)
Checks if time is valid.
Parameters:
  hour - hour to check
Parameters:
  minute - minute to check
Parameters:
  second - second to check true if time is valid, otherwise false



toJulianDate
public static JulianDateStamp toJulianDate(DateTimeStamp time)(Code)
Calculates Astronomical Julian Date from given time stamp. Julian Date stamp



toJulianDate
public static JulianDateStamp toJulianDate(int year, int month, int day, int hour, int minute, double second)(Code)
Calculates Astronomical Julian Date from given time.

Astronomical Julian Dates are counting from noon of the January 1st, -4712 (julian date 0 is -4712/01/01 12:00:00). Zero year exist. Julian Date is always GMT, there are no timezones.

Algorithm based on Numerical Recipesin C, 2nd ed., Cambridge University Press 1992, modified and enhanced by Igor Spasic.
Parameters:
  year - year
Parameters:
  month - month
Parameters:
  day - day
Parameters:
  hour - hour
Parameters:
  minute - minute
Parameters:
  second - second julian time stamp




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.