Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying Hours/Minutes and Midnight with AM/PM
Message
De
15/01/2008 12:47:09
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Displaying Hours/Minutes and Midnight with AM/PM
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01281962
Message ID:
01281962
Vues:
53
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  
.
.
.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform