List of usage examples for java.util GregorianCalendar from
public static GregorianCalendar from(ZonedDateTime zdt)
From source file:ru.anr.base.BaseParent.java
/** * Transforms the given zoned date-time object to a gregorian calendar * //from w w w. j a v a2 s .c o m * @param dateTime * A date-time object * @return A calendar object */ public static Calendar calendar(ZonedDateTime dateTime) { return GregorianCalendar.from(dateTime); }
From source file:ru.anr.base.domain.BaseEntity.java
/** * Performing pre-create actions */ @PrePersist public void prePersist() { setCreated(GregorianCalendar.from(now())); }
From source file:ru.anr.base.domain.BaseEntity.java
/** * Performing pre-update actions */ @PreUpdate public void preUpdate() { setModified(GregorianCalendar.from(now())); }
From source file:ru.anr.base.domain.BaseEntity.java
/** * Changing a state of this object/*w w w. j a v a 2 s.c o m*/ * * @param newState * New state name * @return Old state (being changed) */ public String changeState(String newState) { String oldState = getState(); setState(newState); setStateChanged(GregorianCalendar.from(now())); return oldState; }