mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
some more tests
This commit is contained in:
parent
fcf3ff2bf1
commit
16dc45ab46
11 changed files with 257 additions and 46 deletions
|
|
@ -3,23 +3,25 @@ package de.kosit.validationtool.impl;
|
|||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
*/
|
||||
public class DateFactory {
|
||||
|
||||
private DateFactory() {
|
||||
// hide
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static XMLGregorianCalendar createTimestamp() {
|
||||
try {
|
||||
final GregorianCalendar cal = new GregorianCalendar();
|
||||
cal.setTime(new Date());
|
||||
return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
|
||||
|
||||
} catch (final DatatypeConfigurationException e) {
|
||||
throw new IllegalStateException("Can not create timestamp", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue