Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting character 3:45 PM to 15 and 45 numeric
Message
De
08/02/2008 13:37:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/02/2008 17:13:14
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:
01290609
Message ID:
01290868
Vues:
14
>>> I want to get the 24-hour equivalent numeric values for the hours and minutes.
>>
>>You may need to wrap it in a TRY..CATCH, but this should work for you:
>>
>>
>>cTime = "03:45pm"
>>?HOUR(CTOT("1/1/01 "+cTime))
>>?MINUTE(CTOT("1/1/01 "+cTime))
>>
>
>How does that work? I did work, but it's like magic! Ok, I know it's not magic...

A shorter version might be:

? hour(Ctot( m.cTime )), minute(Ctot( m.cTime ))

and if you need the value in seconds:

? Ctot( m.cTime ) - ctot('0')

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform