TTL unix time java api

I’m trying to expire some documents using the java api. If I provide a TTL of 3 months it doesn’t seem to be working. I don’t get any error but the document doesn’t get inserted at all.

This page says that in order to provide a TTL over 30 days I must provide a ttl ‘unix time’ (what ever that means) rather than a number of seconds from now.

Assuming that this is the problem, the java api the only appears to allow a TTL to be specified in seconds (rather than unix time):

 * Creates a {@link JsonDocument} which the document id, JSON content and the expiration time.
 * @param id the per-bucket unique document id.
 * @param content the content of the document.
 * @param expiry the expiration time of the document.
 * @return a {@link JsonDocument}.
public static JsonDocument create(String id, int expiry, JsonObject content) {
    return new JsonDocument(id, expiry, content, 0, null);

Is there a way to specify a TTL over 30 days using the java api?

expiry is int

expiry < 606024*30 (2592000 seconds) – relative time
expiry > 2592000 – absolute unix time

Ah thanks. Unix time men second since epoch. I’d not heard that expression before