public static <T extends Comparable<?>> TimeExpression<T> asTime(Expression<T> expr) {
        Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
        if (underlyingMixin instanceof PathImpl) {
            return new TimePath<T>((PathImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof OperationImpl) {
            return new TimeOperation<T>((OperationImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof TemplateExpressionImpl) {
            return new TimeTemplate<T>((TemplateExpressionImpl<T>) underlyingMixin);
        } else {
            return new TimeExpression<T>(underlyingMixin) {

                private static final long serialVersionUID = -2402288239000668173L;

                @Override
                public <R, C> R accept(Visitor<R, C> v, C context) {
                    return this.mixin.accept(v, context);
                }

            };
        }
    }
Create a new TimeExpression

@param expr the time Expression
@return new TimeExpression
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java