Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > xml/vb/java common date format

Reply
Thread Tools

xml/vb/java common date format

 
 
Andy Fish
Guest
Posts: n/a
 
      12-20-2003
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



 
Reply With Quote
 
 
 
 
J French
Guest
Posts: n/a
 
      12-20-2003
On Sat, 20 Dec 2003 09:34:24 GMT, "Andy Fish"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Steve Gerrard
Guest
Posts: n/a
 
      12-20-2003

"Andy Fish" <(E-Mail Removed)> wrote in message
news:AIUEb.1645$(E-Mail Removed)...
> 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-comml-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".



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can *common* struct-members of 2 different struct-types, that are thesame for the first common members, be accessed via pointer cast to either struct-type? John Reye C Programming 28 05-08-2012 12:24 AM
java.lang.NoSuchMethodError: wm.common.session.Common.getCustRptListFromMax Denny Java 1 05-01-2008 07:33 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM
xml/vb/java common date format Andy Fish XML 2 12-20-2003 06:13 PM



Advertisments