java.lang.Object | |
↳ | com.atlassian.confluence.core.DateFormatter |
Formats dates and times into a given timezone in a variety of formats. The actual formats are provided by the FormatSettingsManager
which is passed to the constructor. Also allows for formatting into aribitrary formats.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor is deprecated.
Since 3.2 use com.atlassian.confluence.core.DateFormatter#DateFormatter(com.atlassian.confluence.core.TimeZone,
com.atlassian.confluence.core.FormatSettingsManager, com.atlassian.confluence.languages.LocaleManager)
Create a date formatter for the specified timezone.
| |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Formats the date and returns it as a string, using the date formatting pattern.
| |||||||||||
Formats the date as a blog posting date and returns it as a string.
| |||||||||||
Formats the date and returns it as a string, using
FULL as the formatting pattern. | |||||||||||
Formats the date and returns it as a string, using the date-time formatting pattern.
| |||||||||||
This method is deprecated.
since 3.5 this calls through to
format(Date) .
| |||||||||||
Formats the date and returns it as a string, using the given formatting pattern.
| |||||||||||
Same as
format(Date) , but doesn't perform time zone conversion. | |||||||||||
Same as
formatDateFull(Date) , but doesn't perform time zone conversion. | |||||||||||
Same as
formatDateTime(Date) , but doesn't perform time zone conversion. | |||||||||||
Formats the date and returns it as a string, using the time formatting pattern.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
This constructor is deprecated.
Since 3.2 use com.atlassian.confluence.core.DateFormatter#DateFormatter(com.atlassian.confluence.core.TimeZone,
com.atlassian.confluence.core.FormatSettingsManager, com.atlassian.confluence.languages.LocaleManager)
Create a date formatter for the specified timezone.
timeZone | the time zone in which dates will be formatted |
---|
Formats the date and returns it as a string, using the date formatting pattern. This format might be 'yyyy-MM-dd' or something similar.
TheTimeZone
specified in the constructor is used to convert the date from server time to the user's
local time.
Formats the date as a blog posting date and returns it as a string. The format might be 'dd MMM @ h:mm a' or something similar.
This method does not apply theTimeZone
specified in the constructor, but instead uses server's
default time zone. A blog post date is part of its identifier, therefore it must be consistent for all users.
Formats the date and returns it as a string, using the date-time formatting pattern. This format might be 'yyyy-MM-dd HH:mm:ss' or something similar.
TheTimeZone
specified in the constructor is used to convert the date from server time to the user's
local time.
This method is deprecated.
since 3.5 this calls through to format(Date)
.
Returns the same as format(Date)
.
Formats the date and returns it as a string, using the given formatting pattern.
TheTimeZone
specified in the constructor is used to convert the date from server time to the user's
local time.
Same as format(Date)
, but doesn't perform time zone conversion.
Same as formatDateFull(Date)
, but doesn't perform time zone conversion.
Same as formatDateTime(Date)
, but doesn't perform time zone conversion.
Formats the date and returns it as a string, using the time formatting pattern. This format might be 'HH:mm:ss' or something similar.
TheTimeZone
specified in the constructor is used to convert the date from server time to the user's
local time.
formatDateTime(Date)