
clarifai2.grpc.DateTimeConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Clarifai Java API Client
The newest version!
package clarifai2.grpc;
import com.google.protobuf.Timestamp;
import com.google.protobuf.util.Timestamps;
import java.util.Date;
public class DateTimeConverter {
public static Date timestampToDate(Timestamp timestamp) {
return new Date(timestamp.getSeconds() * 1000);
}
public static Timestamp dateToTimestamp(Date dateTime) {
// return Timestamps.fromMillis(dateTime.getTime())
return Timestamp.newBuilder()
.setSeconds(dateTime.getTime())
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy