LOCAL lcTime,lnOffSet,ldDate,lnHour ldDate=CTOD(DTOC(tdTime)) lnOffSet=gnTimeZone-8 lnHour=HOUR(tdTime)+lnOffSet IF lnHour<0 lnHour=24-ABS(lnHour) ldDate=ldDate-1 ENDIF IF lnHour>23 lnHour=lnHour-24 ldDate=ldDate+1 ENDIFwhere gnTimeZone is based on a number from 1 to 24 based on the list you see in the account setup for PUTM features on the time zone field.