com.transferwise.tasks.utils.TimeUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-tasks-core Show documentation
Show all versions of tw-tasks-core Show documentation
Transferwise Tasks Executor - Fire and forget until Alert.
The newest version!
package com.transferwise.tasks.utils;
import java.sql.Timestamp;
import java.time.ZoneId;
import java.time.ZonedDateTime;
public final class TimeUtils {
private TimeUtils() {
throw new AssertionError();
}
public static ZonedDateTime toZonedDateTime(Timestamp timestamp) {
if (timestamp == null) {
return null;
}
return ZonedDateTime.ofInstant(timestamp.toInstant(), ZoneId.systemDefault());
}
}