[New] Added Version.getCreatedZdt() and Version.getUpdatedZdt()

This commit is contained in:
Robert von Burg 2020-10-13 16:50:20 +02:00
parent 8f1966fad4
commit bdca6998f4
1 changed files with 20 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package li.strolch.model;
import java.text.MessageFormat;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
import li.strolch.utils.dbc.DBC;
@ -154,6 +156,15 @@ public class Version {
return this.created;
}
/**
* Returns the date when this version was created
*
* @return the date when this version was created
*/
public ZonedDateTime getCreatedZdt() {
return ZonedDateTime.ofInstant(this.created.toInstant(), ZoneId.systemDefault());
}
/**
* Returns the date when this version was update
*
@ -163,6 +174,15 @@ public class Version {
return this.updated;
}
/**
* Returns the date when this version was update
*
* @return the date when this version was update
*/
public ZonedDateTime getUpdatedZdt() {
return ZonedDateTime.ofInstant(this.updated.toInstant(), ZoneId.systemDefault());
}
/**
* Returns true if this version was deleted, otherwise false
*