Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting TIME() to a readable format
Message
From
21/09/2008 16:28:52
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
21/09/2008 15:55:29
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01349313
Message ID:
01349326
Views:
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.

You might see this if someone responds and you read the thread, but more "readable" probably wasn't the exact goal. More like you said of being more traditional. Our users like things that way.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform