Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6465203

XMLGregorianCalendar to java.sql.Timestamp conversion

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Future Project
    • Icon: P3 P3
    • 5.0
    • 5.0
    • xml
    • generic
    • generic

      An user reported that there's no convenience method from XMLGregorianCalendar to java.sql.Timestamp. Given that Timestamp is a JDK class, perhaps we could define one more helper method like this?

      public Timestamp toTimestamp() {
        // default implementation for backward compatibility.
        // implementation can override this if it wants to make it faster.
        return new Timestamp(toGregorianCalendar().getTimeInMillis());
      }

            joehw Joe Wang
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: