Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change time format
Message
 
À
11/03/2003 21:22:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00763687
Message ID:
00764740
Vues:
23
>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...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform