@Override
    protected OffsetDateTime map(final Traverser.Admin<S> traverser) {
        final Object object = traverser.get();
        OffsetDateTime date;

        if (!(object instanceof OffsetDateTime)) {
            // allow incoming traverser to resolve into Date object for compatibility
            if (object instanceof Date) {
                date = ((Date) object).toInstant().atOffset(ZoneOffset.UTC);
            } else {
                throw new IllegalArgumentException("dateAdd() accept only OffsetDateTime or Date (deprecated).");
            }
        } else {
            date = (OffsetDateTime) object;
        }

        return date.plus(duration);
    }
Reference implementation for date concatenation step.

@author Valentyn Kahamlyk
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/DateAddStep.java