Home > Archive > Visual Basic > March 2006 > vb6 and iso 8601 date format
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
vb6 and iso 8601 date format
|
|
| Andy Fish 2006-03-21, 9:56 pm |
| 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
| |
| Tony Proctor 2006-03-21, 9:56 pm |
| 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
"Andy Fish" <ajfish@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
>
>
| |
| Bob Butler 2006-03-21, 9:56 pm |
| "Tony Proctor" <tony_proctor@aimtechnology_NoMoreSPAM_.com> wrote in
message news:ufykDKRTGHA.1868@TK2MSFTNGP09.phx.gbl[color=darkred]
> 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" <ajfish@blueyonder.co.uk> wrote in message
> news:#9lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
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..."
| |
| Andy Fish 2006-03-22, 7:57 am |
|
"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
>
> 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
| |
| Phill W. 2006-03-22, 7:57 am |
|
"Andy Fish" <ajfish@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.
| |
| Andy Fish 2006-03-29, 7:55 am |
|
"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" <ajfish@blueyonder.co.uk> wrote in message
> news:%239lpFnQTGHA.4960@TK2MSFTNGP12.phx.gbl...
>
>
> 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.
>
>
| |
| Tony Proctor 2006-03-29, 6:56 pm |
| 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
"Andy Fish" <ajfish@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...
complex[color=darkred]
>
> 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
>
> :-(((
>
>
>
>
|
|
|
|
|