Package org.ametys.plugins.survey
Class SurveyDateUtils
java.lang.Object
org.ametys.plugins.survey.SurveyDateUtils
Survey date utils
FIXME When the plugins Survey will be not compatible with 4.2.x version, use the methods in
DateUtils
See issue SURVEY-208-
Method Summary
Modifier and TypeMethodDescriptionstatic CalendarasCalendar(ZonedDateTime zonedDateTime) Converts thisZonedDateTimeobject to aCalendar.static ZonedDateTimeasZonedDateTime(Calendar calendar) Converts thisCalendarobject to aZonedDateTime.static ZonedDateTimeparseZonedDateTime(String zonedDateTimeAsString) Parses a String into aZonedDateTime, using ISO date formatter.static StringzonedDateTimeToString(ZonedDateTime zonedDateTime) Converts aZonedDateTimeobject toStringusing the ISO date formatter
-
Method Details
-
asZonedDateTime
Converts thisCalendarobject to aZonedDateTime.- Parameters:
calendar- the calendar- Returns:
- an instant representing the same point on the time-line as this
Calendarobject
-
asCalendar
Converts thisZonedDateTimeobject to aCalendar.- Parameters:
zonedDateTime- the zoned date time- Returns:
- the
Calendarobject
-
zonedDateTimeToString
Converts aZonedDateTimeobject toStringusing the ISO date formatter- Parameters:
zonedDateTime- the zoned date time- Returns:
- the zoned date time as a
String
-
parseZonedDateTime
Parses a String into aZonedDateTime, using ISO date formatter.- Parameters:
zonedDateTimeAsString- the zoned date time as string- Returns:
- the
ZonedDateTimeobject
-