Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   xml/vb/java common date format (http://www.velocityreviews.com/forums/t166298-xml-vb-java-common-date-format.html)

Andy Fish 12-20-2003 09:34 AM

xml/vb/java common date format
 
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 12-20-2003 11:49 AM

Re: xml/vb/java common date format
 
On Sat, 20 Dec 2003 09:34:24 GMT, "Andy Fish"
<ajfish@blueyonder.co.uk> 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

Steve Gerrard 12-20-2003 06:13 PM

Re: xml/vb/java common date format
 

"Andy Fish" <ajfish@blueyonder.co.uk> wrote in message
news:AIUEb.1645$Zd3.15118507@news-text.cableinet.net...
> 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".





All times are GMT. The time now is 07:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.