Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying Hours/Minutes and Midnight with AM/PM
Message
 
À
15/01/2008 12:47:09
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01281962
Message ID:
01281969
Vues:
10
>I'm having trouble working midnight into this equation. I need it to be 'AM', but the way I have it written, midnight will be 'PM' and noon will be 'AM' if the iStartingAM is set to TRUE. Just the reverse of what I need. The scenario won't come up often, if ever, but I have to account for the possibility. These statements are in loops (iHour changes value), and there is more code inbetween, but but this should be enough to get the gist of it.
>
>
>
>iHour = 24
>m.StartingAM = .T.
>
>REPLACE AppointmentTypeSetsEdit.DisplayTime WITH PADL(AppointmentTypeSetsEdit.Hour, 2, '0') ;
>     + ':' + '00' + ' ' ;
>     + IIF(iHour>=12 AND iHour<=24,IIF(m.StartingAM,'PM','AM'),'AM')
>
>REPLACE AppointmentTypeSetsEdit.DisplayTime WITH PADL(AppointmentTypeSetsEdit.Hour, 2,'0') ;
>     + ':' + PADL(AppointmentTypeSetsEdit.Minute, 2, '0') + ' ' ;
>     + IIF(iHour>=12 AND iHour<=24,IIF(m.StartingAM,'PM','AM'),'AM')
>
>
>
>Partial results...
>
>
>.
>.
>.
>23:00 PM
>23:15 PM
>23:30 PM
>23:45 PM
>24:00 PM
>24:15 PM
>24:30 PM
>24:45 PM
>01:00 AM
>.
>.
>.
>
iHour = 24
m.StartingAM = .T.
REPLACE AppointmentTypeSetsEdit.DisplayTime WITH PADL(AppointmentTypeSetsEdit.Hour, 2, '0') ;
     + ':' + '00' + ' ' ;
     + IIF(iHour> 12 AND iHour < 24,IIF(m.StartingAM,'PM','AM'),'AM')
Is that what you want?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform