Claus Mygind
2008-12-05 15:03:05 UTC
I have an associative array element value "12/5/2008" type is character. I
wish to store it in a variable in dToS() format "20081205".
Should be easy enough (I thought) without using subStr() to pick it appart
and reassemble.
For some reason I keep coming up with a blank value.
Here are some ways I have tried:
~~~~~1st attempt:~~~~~~~~~~~~~~~~~~~~~~
cWorkDay = dToS( cToD( oCGI["WORKDAY"] ))
***Actual result of 1st attempt:***
oCGI["WORKDAY"] = '12/5/2008'
type( 'oCGI["WORKDAY"]' ) = C
cWorkDay =
type( 'cWorkDay') = C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~2nd attempt:~~~~~~~~~~~~~~~~~~~~~~~~
chk = oCGI["WORKDAY"]
wkDate = cToD(chk)
cWorkDay= dToS( wkDate )
***Actual result of 2nd attempt:***
oCGI["WORKDAY"] = '12/5/2008'
type( 'oCGI["WORKDAY"]' ) = C
chk = '12/5/2008'
type( 'chk' ) = C
wkDate = / /
type( 'wkDate' ) = D
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wish to store it in a variable in dToS() format "20081205".
Should be easy enough (I thought) without using subStr() to pick it appart
and reassemble.
For some reason I keep coming up with a blank value.
Here are some ways I have tried:
~~~~~1st attempt:~~~~~~~~~~~~~~~~~~~~~~
cWorkDay = dToS( cToD( oCGI["WORKDAY"] ))
***Actual result of 1st attempt:***
oCGI["WORKDAY"] = '12/5/2008'
type( 'oCGI["WORKDAY"]' ) = C
cWorkDay =
type( 'cWorkDay') = C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~2nd attempt:~~~~~~~~~~~~~~~~~~~~~~~~
chk = oCGI["WORKDAY"]
wkDate = cToD(chk)
cWorkDay= dToS( wkDate )
***Actual result of 2nd attempt:***
oCGI["WORKDAY"] = '12/5/2008'
type( 'oCGI["WORKDAY"]' ) = C
chk = '12/5/2008'
type( 'chk' ) = C
wkDate = / /
type( 'wkDate' ) = D
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~