com.bloxbean.cardano.client.backend.gql.util.DateUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cardano-client-backend-gql Show documentation
Show all versions of cardano-client-backend-gql Show documentation
Cardano Client Library - GraphQL Backend
package com.bloxbean.cardano.client.backend.gql.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateUtil {
public static long convertDateTimeToLong(String dateTimeInGMT) {
try {
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
inputFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Date dt = inputFormat.parse(dateTimeInGMT);
return dt.getTime();
} catch (Exception e) {
return 0;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy