Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Military Time
Message
De
01/08/2007 17:49:14
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
01/08/2007 16:30:01
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01245247
Message ID:
01245305
Vues:
29
>>>How can I convert the following to non-military time? And yes, before the jokes start, the "13:45" is a value in an array. I can't just retype it to "1:45" instead. Thanks!
>>>
>>>
>>>(RIGHT( "0" + ALLTRIM( "13:45" ), 5 ))
>>>
>>
>>Forest for the trees kinda thing? Maybe you should consider Miller time instead! :)
>>
>>Start with this and add am/pm or what have you.
>>?Normaltime("13:45")
>>
>>NORMALTIME.PRG
>>LPARAMETERS m.tcTime
>>LOCAL m.lnHours, m.lcHours, m.lcMinutes
>>lnColon = AT(":",m.tcTime)
>>m.lnHours = val(LEFT(m.tcTime,m.lnColon-1))
>>m.lcHours = right("0"+str(iif(m.lnHours>12,m.lnHours-12,m.lnHours)),2)
>>m.lcMinutes = SUBSTR(m.tcTime,m.lnColon)
>>RETURN m.lcHours + m.lcMinutes
>
>
>Hi Mike:
>
>Your function does not return the correct value if you plug in the military time '0001' or '00:01' 24:30 is not military time, 0030 is. 2400 is only used to represent midnight. Midnight + 1 minute is 0001 hours.

I didn't know that. I'm not in the military. ;)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform