Package net.sf.saxon.value

Examples of net.sf.saxon.value.DateValue


  public static AtomicValue convertToAtomicValue(Object value) throws TransformerException {
    if (value instanceof java.util.Date) { //special handling for time types
          java.util.Date d = (java.util.Date)value;
          DateTimeValue tdv = DateTimeValue.fromJavaDate(d);
          if (value instanceof Date) {
            value = new DateValue(tdv.getYear(), tdv.getMonth(), tdv.getDay(), tdv.getTimezoneInMinutes());
          } else if (value instanceof Time) {
            value = new TimeValue(tdv.getHour(), tdv.getMinute(), tdv.getSecond(), tdv.getMicrosecond(), tdv.getTimezoneInMinutes());
          } else if (value instanceof Timestamp) {
            Timestamp ts = (Timestamp)value;
            value = tdv.add(DayTimeDurationValue.fromMicroseconds(ts.getNanos() / 1000));
View Full Code Here

TOP

Related Classes of net.sf.saxon.value.DateValue

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.