Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change time format
Message
 
To
11/03/2003 21:22:04
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00763687
Message ID:
00764740
Views:
24
>How's this?
>
>FUNCTION Time12Hr
>    PARAMETERS cTm
>    LOCAL nHr
>
>    IF PCOUNT()==0 THEN
>        cTm = TIME()
>    ENDIF
>    nHr = VAL(LEFT(m.cTm,2))
>    RETURN TRANSFORM((m.nHr+11)%12+1)+" "+IIF(m.nHr>=12,"PM","AM")
>ENDFOR
>


Way cool. I knew my old stuff was brute force methodology, while yours is executed with great finesse. Thanks, Naoto. The last two lines need to be tweaked into these three lines:
    cMin = SUBSTR(cTm,3,3)
    RETURN TRANSFORM((m.nHr+11)%12+1)+cMin+" "+IIF(m.nHr>=12,"PM","AM")
ENDFUNC
Randy Bosma
VFP - Because life is too short to code in something else...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform