Foxpro convert date and time to DateTime variable
By jasperdg on Mar 13, 2008 | In Programmeren
On the net some silly, unuseable answers have been posted where programmers just concatenate DTOC() and DATE(). This is wrong! The DTOC() function depends on local date settings, thus resulting string of characters can not be predicted.
That's why I had to invent this little function:
FUNCTION DTtoDateTime(ldDate,lcTime)
RETURN DATETIME(YEAR(ldDate),MONTH(ldDate),DAY(ldDate),;
VAL(LEFT(lcTime,2)),VAL(RIGHT(lcTime,2)))
ENDFUNC This function is independent to local date and time settings.
| « Muziek omzetten van het ene formaat naar het andere | Belastingdienst Onbereikbaar » |
