users@jaxb.java.net

Re: xsd:date with finer resolution

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Mon, 29 Jun 2009 10:22:20 +0200

Why can't you use xsd:dateTime and its (default) binding to
XMLGregorianCalendar?
-W

On Sun, Jun 28, 2009 at 6:48 AM, Christopher Piggott <cpiggott_at_gmail.com>wrote:

> Hi,
>
> I want to map xsd:date to a java.util.Date but I want to do it with
> millisecond resolution. What are my best options for doing this?
> This is for a jersey application so having my own custom parse/print
> class isn't a great option. My first attempt was this:
>
> <xsd:element name="timestamp" type="xsd:date">
> <xsd:annotation>
> <xsd:appinfo>
> <jaxb:javaType
> name="java.util.Date"
> xmlType="xsd:date"
>
> printMethod="javax.xml.bind.DatatypeConverter.printDate"
>
> parseMethod="javax.xml.bind.DatatypeConverter.parseDate"/>
> </xsd:appinfo>
> </xsd:annotation>
> </xsd:element>
>
> It didn't work out so well. I suppose I could just use a long, but I
> was hoping to have a little bit stronger typing than that. Basically,
> all I need is a date/time but with msec resolution.
>
> --Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>