Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Military Time
Message
De
01/08/2007 15:42:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
01/08/2007 15:37:55
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, É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:
01245249
Vues:
27
>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 ))
>
I don't know about any standard functions to do that.

You would have to:
  • Get the hours
  • Get the minutes

    Only if hours is >= 12:

  • Subtract 12
  • Interpret the time as PM
  • If the hours is exactly 0, change it to 12

    HTH,

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform