Date
class implements helper functions on top of the java.util.Date
class. This also has the flexibility to represent a calendar date which is a date/time representation independent of timezone when used with the Ariba Formatter classes. For example a calendar date representing 7:30 AM, Friday July 9th 1999 will appear as such independent of the timezone the client inspecting the date is in. The Date object using and not using the calendar date flag are not interchangeable in all cases. For example you may not change the metadata layer to use a calendar date unless the code is also aware of the change. Calendar dates are not fully supported in this release and are only intended to be used with any time cards or expense report modules. @aribaapi documented
The SQL date format represents a date as yyyy-mm-dd. Note that this date format only deals with year, month and day values. There are no values for hours, minutes, seconds.
This contrasts with regular java.util.Date values, which include time values for hours, minutes, seconds, milliseconds.
Time points are handled as millisecond values - milliseconds since the epoch, January 1st 1970, 00:00:00.000 GMT. Time values passed to the java.sql.Date class are "normalised" to the time 00:00:00.000 GMT on the date implied by the time value.
and their definitions of "Systems of Time" at:
http://tycho.usno.navy.mil/systime.html
In all methods of class Date
that accept or return year, month, date, hours, minutes, and seconds values, the following representations are used:
- 1900
. In all cases, arguments given to methods for these purposes need not fall within the indicated ranges; for example, a date may be specified as January 32 and is interpreted as meaning February 1. @author James Gosling @author Arthur van Hoff @author Alan Liu @version 1.84, 11/23/06 @see java.text.DateFormat @see java.util.Calendar @see java.util.TimeZone @since JDK1.0
TODO: other methods to implement comparison methods:
The date tag will allow you to format a Date in a quick and easy way. You can specify a custom format (eg. "dd/MM/yyyy hh:mm"), you can generate easy readable notations (like "in 2 hours, 14 minutes"), or you can just fall back on a predefined format with key 'struts.date.format' in your properties file. If that key is not defined, it will finally fall back to the default DateFormat.MEDIUM formatting. Note: If the requested Date object isn't found on the stack, a blank will be returned.
Configurable attributes are :-i18n key | default |
struts.date.format.past | {0} ago |
struts.date.format.future | in {0} |
struts.date.format.seconds | an instant |
struts.date.format.minutes | {0,choice,1#one minute|1<{0} minutes} |
struts.date.format.hours | {0,choice,1#one hour|1<{0} hours}{1,choice,0#|1#, one minute|1<, {1} minutes} |
struts.date.format.days | {0,choice,1#one day|1<{0} days}{1,choice,0#|1#, one hour|1<, {1} hours} |
struts.date.format.years | {0,choice,1#one year|1<{0} years}{1,choice,0#|1#, one day|1<, {1} days} |
In this case the format attribute will be used.
Condition 3: With nice attribute as false and no format attribute is specifiedi18n key | default |
struts.date.format | if one is not found DateFormat.MEDIUM format will be used |
<s:date name="person.birthday" format="dd/MM/yyyy" /> <s:date name="person.birthday" format="%{getText('some.i18n.key')}" /> <s:date name="person.birthday" nice="true" /> <s:date name="person.birthday" />
Date
The format is defined by W3C XML Schema Recommendation and ISO8601 i.e (-)CCYY-MM-DD(Z|(+|-)hh:mm) @author Arnaud Blandin @author Edward Kuns @version $Revision: 7289 $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|