Selisih Waktu pada Visual Foxpro

FUNCTION Time2Time(cTime1,cTime2)
LOCAL cJam,nJam, nMenit, nDetik, nDetik1, nDetik2, nDetik3
nDetik1 = VAL(SUBSTR(cTime1,1,2))*3600+VAL(SUBSTR(cTime1,4,2))*60+VAL(SUBSTR(cTime1,7))
nDetik2 = VAL(SUBSTR(cTime2,1,2))*3600+VAL(SUBSTR(cTime2,4,2))*60+VAL(SUBSTR(cTime2,7))
nDetik3 = ABS(nDetik2-nDetik1)
nJam = INT(nDetik3/3600)
nMenit = INT((nDetik3-nJam*3600)/60)
nDetik = nDetik3-nJam*3600-nMenit*60
cJam = RIGHT(’00’+LTRIM(STR(nJam)),2)+’:’+RIGHT(’00’+LTRIM(STR(nMenit)),2)+’:’+RIGHT(’00’+LTRIM(STR(nDetik)),2)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s