Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting TIME() to a readable format
Message
De
21/09/2008 15:55:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/09/2008 15:19:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01349313
Message ID:
01349323
Vues:
23
>>>>Is there a cleaner/better way of converting a time() to a more readable format?
>>>>
>>>>m.DisplayTime = RIGHT(TRANSFORM(CTOT(TRANSFORM(TIME(),'@R 99999999'))),11)
>>>>
>>>
>>>The TIME() is pretty readable. What exactly do you want to change? What format do you want time to be presented in ?
>>>On my PC your expression returns the same as TIME() prefixed with '99 ' - '99 13:28:00'
>>
>>Mine returns:
>>
>>14:03:13
>>
>>I need:
>>
>>02:03:13 PM
>>
>>I'm sure it's due to the environmental settings, but that's what they are set to.
>
set hours to 12
>?Ttoc(datetime(),2)
I still don't see how is 02:03:13 PM more readable than 14:03:13 - both are sets of numbers, but the first one has an ambiguous piece which needs an additional qualifier to disambiguate it, and that one is detached, at the opposite end of the string. In my book, that's less readable. More traditional and habitual, yes, but I wouldn't go so far to call it more readable.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform