Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time format
Message
From
23/02/2009 09:26:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/02/2009 02:20:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01383407
Message ID:
01383464
Views:
37
>>> It still returns the time as 14:52..
>
>Are you using the TIME() functions? that can't return 12 hour format, from the help file:
>
>
>"Use SET HOURS TO without 12 or 24 to return to the default 12-hour format.
>
>TIME( ) always returns a value in 24-hour format and isn't affected by SET HOURS. The value returned by DATETIME( ) is determined by the current SET HOURS setting.
>
>SET HOURS is scoped to the current data session."
>
>
>SET HOURS effect the display of time in fields.
>
>you could use DATETIME() to get the time only, like this:
>
>SET HOURS TO 12
>lcTime=RIGHT(TTOC(DATETIME()),11)
>?lcTime
>
Actually, with passing the additional parameter to ttoc() and changing the settings, you get different outputs:
?TTOC(DATETIME(),2)
* 09:23:58
SET SECONDS OFF
?TTOC(DATETIME(),2)
* 09:24
SET HOURS TO 12
?TTOC(DATETIME(),2)
* 09:24 AM
BTW, I think Evelyn's customers are too americanized...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform