xml/vb/java common date format

Discussion in 'XML' started by Andy Fish, Dec 20, 2003.

  1. Andy Fish

    Andy Fish Guest

    Hi,

    I have an application with a vb6 client that talks to a java server and
    passes XML back and forward, and I'm wondering what's the best format to
    transfer date/time values between them in an XML attribute.

    my first thougtht was to use RFC822 date/time format because I can produce
    and consume those with javamail's MailDateFormat, but I can't find code to
    do that for VB (well, I found one module on vbrad.com but it wouldn't parse
    the dates created by MailDateFormat)

    I really hate reinventing the wheel - does anyone know of a date/time format
    that can be used with minimal fuss and maximum portability, with free code
    available for both java and vb

    Andy
    Andy Fish, Dec 20, 2003
    #1
    1. Advertising

  2. Andy Fish

    J French Guest

    On Sat, 20 Dec 2003 09:34:24 GMT, "Andy Fish"
    <> wrote:

    >Hi,
    >
    >I have an application with a vb6 client that talks to a java server and
    >passes XML back and forward, and I'm wondering what's the best format to
    >transfer date/time values between them in an XML attribute.
    >
    >my first thougtht was to use RFC822 date/time format because I can produce
    >and consume those with javamail's MailDateFormat, but I can't find code to
    >do that for VB (well, I found one module on vbrad.com but it wouldn't parse
    >the dates created by MailDateFormat)
    >
    >I really hate reinventing the wheel - does anyone know of a date/time format
    >that can be used with minimal fuss and maximum portability, with free code
    >available for both java and vb


    I don't know about Java but ...

    I would definitely opt for : yyyy-mm-dd hh:mm:ss (24 hour)

    Have a look at VB's Format() command

    For decoding I strongly recommend that you do it yourself using Mid$()
    and Val()
    - then make a Date (8 byte IEEE) using DateSerial and TimeSerial

    VB is far too clever at decoding a Date String
    - it is also 'locale' aware
    J French, Dec 20, 2003
    #2
    1. Advertising

  3. "Andy Fish" <> wrote in message
    news:AIUEb.1645$...
    > Hi,
    >
    > I have an application with a vb6 client that talks to a java server

    and
    > passes XML back and forward, and I'm wondering what's the best format

    to
    > transfer date/time values between them in an XML attribute.
    >


    This is some poop out of MSDN on XML data types. It is from Microsoft,
    but it at least has the appearance of being universal and not system
    specific. I would think most XML parsers would process these correctly.

    <Schema name="myschema"
    xmlns="urn:schemas-microsoft-com:xml-data"
    xmlns:dt="urn:schemas-microsoft-com:datatypes">
    </Schema>

    XML Data Types:

    date: Date in a subset ISO 8601 format, without the time data. For
    example: "1994-11-05".

    dateTime: Date in a subset of ISO 8601 format, with optional time and no
    optional zone. For example, "1988-04-07T18:39:09".

    dateTime.tz: Date in a subset ISO 8601 format, with optional time and
    optional zone. For example: 1988-04-07T18:39:09-08:00".
    Steve Gerrard, Dec 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Candy
    Replies:
    2
    Views:
    1,156
    Janaka
    Feb 18, 2004
  2. Andy Fish

    xml/vb/java common date format

    Andy Fish, Dec 20, 2003, in forum: Java
    Replies:
    2
    Views:
    525
    Steve Gerrard
    Dec 20, 2003
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,244
    Michael Borgwardt
    May 30, 2004
  4. Denny
    Replies:
    1
    Views:
    774
  5. John Reye
    Replies:
    28
    Views:
    1,363
    Tim Rentsch
    May 8, 2012
Loading...

Share This Page