Package org.ametys.plugins.survey
Class SurveyDateUtils
- java.lang.Object
-
- org.ametys.plugins.survey.SurveyDateUtils
-
public final class SurveyDateUtils extends Object
Survey date utils FIXME When the plugins Survey will be not compatible with 4.2.x version, use the methods inDateUtilsSee issue SURVEY-208
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
asZonedDateTime
public static ZonedDateTime asZonedDateTime(Calendar calendar)
Converts thisCalendarobject to aZonedDateTime.- Parameters:
calendar- the calendar- Returns:
- an instant representing the same point on the time-line as this
Calendarobject
-
asCalendar
public static Calendar asCalendar(ZonedDateTime zonedDateTime)
Converts thisZonedDateTimeobject to aCalendar.- Parameters:
zonedDateTime- the zoned date time- Returns:
- the
Calendarobject
-
zonedDateTimeToString
public static String zonedDateTimeToString(ZonedDateTime zonedDateTime)
Converts aZonedDateTimeobject toStringusing the ISO date formatter- Parameters:
zonedDateTime- the zoned date time- Returns:
- the zoned date time as a
String
-
parseZonedDateTime
public static ZonedDateTime parseZonedDateTime(String zonedDateTimeAsString)
Parses a String into aZonedDateTime, using ISO date formatter.- Parameters:
zonedDateTimeAsString- the zoned date time as string- Returns:
- the
ZonedDateTimeobject
-
-