xml/vb/java common date format

Andy Fish

Usenet Archive
Joined
Dec 30, 2002
Messages
605
Reaction score
0
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
 

J French

Usenet Archive
Joined
Sep 19, 2001
Messages
28
Reaction score
0
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
 

Steve Gerrard

Usenet Archive
Joined
Dec 20, 2003
Messages
6
Reaction score
0
Andy Fish said:
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:

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".
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top