All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hcxprotocol.utils.DateTimeUtils Maven / Gradle / Ivy

Go to download

The SDK for HCX Participant System to help in integrating with HCX Gateway easily.

There is a newer version: 1.0.8
Show newest version
package io.hcxprotocol.utils;

import lombok.experimental.UtilityClass;
import org.joda.time.DateTime;

/**
 * The Date time Util to validate timestamp.
 */
@UtilityClass
public class DateTimeUtils {

    public static boolean validTimestamp(String timestamp) {
        try {
            DateTime requestTime = new DateTime(timestamp);
            DateTime currentTime = DateTime.now();
            return !requestTime.isAfter(currentTime);
        } catch (Exception e) {
            return false;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy