Package com.volantis.xml.expression.atomic.temporal

Examples of com.volantis.xml.expression.atomic.temporal.DateTimeValue


       
        Value result = Sequence.EMPTY;
        if (arguments[0].getSequence() != Sequence.EMPTY) {
            DurationValue duration = context.getFactory().createDurationValue(
                    arguments[0].stringValue().asJavaString());
            DateTimeValue dateTime = CurrentDateTimeHelper
                    .getCurrentDateTimeValue(context);
            DateTimeValue newDateTime = ((SimpleDateTimeValue) dateTime)
                    .add(duration);
            long seconds = (newDateTime.getCalendar().getTimeInMillis() - dateTime
                    .getCalendar().getTimeInMillis()) / 1000;
            result = context.getFactory().createIntValue((int) seconds);
        }
        return result;
    }
View Full Code Here


     *                {@link DateTimeValue} instance
     * @return new date time value for current date and time
     */
    public static DateTimeValue getCurrentDateTimeValue(
            ExpressionContext context) {
        DateTimeValue value = (DateTimeValue) context.getProperty(
                DateTimeValue.class);
        if (value == null) {
            final TimeZone timeZone = (TimeZone) context.getProperty(
                    TimeZone.class);
            final Calendar calendar;
View Full Code Here

        }
        ExpressionFactory factory = context.getFactory();
        SimpleDateTimeValue first = (SimpleDateTimeValue)
                factory.createDateTimeValue(
                        arguments[0].stringValue().asJavaString());
        DateTimeValue second = factory.createDateTimeValue(
                arguments[1].stringValue().asJavaString());
        return first.subtract(second);
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.atomic.temporal.DateTimeValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.