Convert to iso-date string to datatype DATe

greeshma

Member
Convert iso-date string to datatype DATE

Hi all,
Please advice me ,
how we can convert that iso-string to DATE?

DEF VAR v-date AS DATE INIT "10/11/2010".
DEF VAR v-string AS CHAR .
v-string = ISO-DATE(v-date).
MESSAGE v-string. (op: 2010-10-11)

i wish to convert this string (2010-10-11) to DATE format.
Please help me.
 
You don't say anything about your date format setting (-d start parameter for the client session).

In general you can use the date function to convert other data types into dates. You can feed the date function either with a character (but in this case it must comply with the American date format mm-dd-yyyy) or you can feed it with three integers for month, day and year respectively.

MESSAGE DATE (
INTEGER ( ENTRY ( 3, v-string, '-' ) ), /* Month */
INTEGER ( ENTRY ( 2, v-string, '-' ) ), /* Day */
INTEGER ( ENTRY ( 1, v-string, '-' ) ) /* Year */
) VIEW-AS ALERT-BOX INFO.

Note that you need to swap day and moth depending on your date format.

Heavy Regards, RealHeavyDude.
 
Back
Top