>FUNCTION SomeFunc()
>LPARAMETERS cDateTimeStr
>
> LOCAL ltRetVal, lnYear, lnMonth, lnDay, lnHours, lnMinutes, lnSeconds
>
> lnYear = VAL(SUBSTR(cDateTimeStr, 1, 4))
> lnMonth = VAL(SUBSTR(cDateTimeStr, 6, 2))
> lnDay = VAL(SUBSTR(cDateTimeStr, 9, 2))
> lnHours = VAL(SUBSTR(cDateTimeStr, 12, 2))
> lnMinutes = VAL(SUBSTR(cDateTimeStr, 15, 2))
> lnSeconds = VAL(SUBSTR(cDateTimeStr, 18, 2))
>
> ltRetVal = DATETIME(lnYear, lnMonth, lnDay, lnHours, lnMinutes, lnSeconds)
>
>RETURN ltRetVal
Thanks, I like this one better as it handles the datetime no matter the local date settings.