Home All Groups Group Topic Archive Search About

vb6 and iso 8601 date format

Author
21 Mar 2006 5:06 PM
Andy Fish
Hi,

I'm using the soap toolkit version 3 from VB6 and because I have complex
types in the API, I'm using the IXMLDOMNodeList interface.

However, it seems that this means I have to do my own date formatting and
parsing.

anyone know of any free source code in vb6 to convert between the vb6 date
type and ISO8601? Obviously converting vb->iso is easy, but parsing is a bit
more tricky

TIA

Andy

Author
21 Mar 2006 6:08 PM
Tony Proctor
VB accepts some variations of the ISO date format Andy, as does SQL. For
instance

    Debug.print CDate("2006-11-30")

correctly yields 30-nov-2006. If you mean the ISO variation without the
separators then inserting them first shouldn't be too difficult since the
offsets are fixed.

Going the other way is pretty easy too:

    Debug.Print Format$(#30-nov-2006#, "yyyy-mm-dd")


        Tony Proctor


Show quoteHide quote
"Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
news:#9lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I'm using the soap toolkit version 3 from VB6 and because I have complex
> types in the API, I'm using the IXMLDOMNodeList interface.
>
> However, it seems that this means I have to do my own date formatting and
> parsing.
>
> anyone know of any free source code in vb6 to convert between the vb6 date
> type and ISO8601? Obviously converting vb->iso is easy, but parsing is a
bit
> more tricky
>
> TIA
>
> Andy
>
>
Author
21 Mar 2006 8:49 PM
Bob Butler
Show quote Hide quote
"Tony Proctor" <tony_proctor@aimtechnology_NoMoreSPAM_.com> wrote in
message news:ufykDKRTGHA.1868@TK2MSFTNGP09.phx.gbl
> VB accepts some variations of the ISO date format Andy, as does SQL.
> For instance
>
>     Debug.print CDate("2006-11-30")
>
> correctly yields 30-nov-2006. If you mean the ISO variation without
> the separators then inserting them first shouldn't be too difficult
> since the offsets are fixed.
>
> Going the other way is pretty easy too:
>
>     Debug.Print Format$(#30-nov-2006#, "yyyy-mm-dd")
> "Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
> news:#9lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
>> anyone know of any free source code in vb6 to convert between the
>> vb6 date type and ISO8601? Obviously converting vb->iso is easy, but
>> parsing is a bit more tricky

The DateSerial and TimeSerial functions are also useful when parsing dates
in fixed string formats

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
22 Mar 2006 10:02 AM
Andy Fish
Show quote Hide quote
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:eCvRmjSTGHA.4864@TK2MSFTNGP12.phx.gbl...
> "Tony Proctor" <tony_proctor@aimtechnology_NoMoreSPAM_.com> wrote in
> message news:ufykDKRTGHA.1868@TK2MSFTNGP09.phx.gbl
>> VB accepts some variations of the ISO date format Andy, as does SQL.
>> For instance
>>
>>     Debug.print CDate("2006-11-30")
>>
>> correctly yields 30-nov-2006. If you mean the ISO variation without
>> the separators then inserting them first shouldn't be too difficult
>> since the offsets are fixed.
>>
>> Going the other way is pretty easy too:
>>
>>     Debug.Print Format$(#30-nov-2006#, "yyyy-mm-dd")
>> "Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
>> news:#9lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
>>> anyone know of any free source code in vb6 to convert between the
>>> vb6 date type and ISO8601? Obviously converting vb->iso is easy, but
>>> parsing is a bit more tricky
>
> The DateSerial and TimeSerial functions are also useful when parsing dates
> in fixed string formats
>

Thanks guys.

The problem is that iso8601 has a number of different variations. I would
like the software to be as open as possible so I'd rather have some kind of
library routine that accepts them all. However, it looks like I'm stuck with
rolling my own

Andy
Author
22 Mar 2006 10:05 AM
Phill W.
"Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
news:%239lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...

> I'm using the soap toolkit version 3 from VB6 and because I have complex
> types in the API, I'm using the IXMLDOMNodeList interface.
>
> anyone know of any free source code in vb6 to convert between the vb6 date
> type and ISO8601?

Is that the one that drops a letter "T" between the date and time?
If so, replace the "T" with a space and, with a bit of luck, CDate()
should be able to make sense of it.

HTH,
    Phill  W.
Author
29 Mar 2006 12:58 PM
Andy Fish
Show quote Hide quote
"Phill W." <p-.a-.w-a-r-d@o-p-e-n.a-c.u-k> wrote in message
news:dvr7ec$hes$1@yarrow.open.ac.uk...
>
> "Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
> news:%239lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
>
>> I'm using the soap toolkit version 3 from VB6 and because I have complex
>> types in the API, I'm using the IXMLDOMNodeList interface.
>>
>> anyone know of any free source code in vb6 to convert between the vb6
>> date type and ISO8601?
>
> Is that the one that drops a letter "T" between the date and time?
> If so, replace the "T" with a space and, with a bit of luck, CDate()
> should be able to make sense of it.
>

unfortunately it's the "luck" element that I'd rather not rely on with VB
because experience has told me it runs out sooner or later

e.g. try cdate("0007-01-01") and you'll get either 7th jan 2001 or 1st july
2001 depending where you live

Show quoteHide quote
:-(((


> HTH,
>    Phill  W.
>
>
Author
29 Mar 2006 3:20 PM
Tony Proctor
That's an invalid ISO-format date Andy, and the results therefore don't
surprise me. Had it been

    cdate("2007-01-01")

then the result would be unambiguous, with no 'luck' involved :-)

    Tony Proctor

Show quoteHide quote
"Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
news:#fe#4BzUGHA.4300@TK2MSFTNGP14.phx.gbl...
>
> "Phill W." <p-.a-.w-a-r-d@o-p-e-n.a-c.u-k> wrote in message
> news:dvr7ec$hes$1@yarrow.open.ac.uk...
> >
> > "Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
> > news:%239lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
> >
> >> I'm using the soap toolkit version 3 from VB6 and because I have
complex
> >> types in the API, I'm using the IXMLDOMNodeList interface.
> >>
> >> anyone know of any free source code in vb6 to convert between the vb6
> >> date type and ISO8601?
> >
> > Is that the one that drops a letter "T" between the date and time?
> > If so, replace the "T" with a space and, with a bit of luck, CDate()
> > should be able to make sense of it.
> >
>
> unfortunately it's the "luck" element that I'd rather not rely on with VB
> because experience has told me it runs out sooner or later
>
> e.g. try cdate("0007-01-01") and you'll get either 7th jan 2001 or 1st
july
> 2001 depending where you live
>
> :-(((
>
>
> > HTH,
> >    Phill  W.
> >
> >
>
>