Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CTOT and Getting Wrong Time
Message
From
28/02/2008 07:44:31
 
 
To
27/02/2008 19:09:21
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01297205
Message ID:
01297316
Views:
13
>I have this:
>
>
>ApptRules.EndTime = "02:45 PM"
>
>CTOT( "01/01/2000 : " + ApptRules.EndTime)
>
>
>The result is:
>
>
>01/01/2000 12:02:45 PM
>
>
>When I thought it would be:
>
>
>01/01/2000 02:45 PM
>
Jay,

I see you got the problem fixed, but just as a warning, I tend to stay away from CTOT() and CTOD() because the dates you pass in can be ambiguous. I would use the DATETIME() and DATE() functions instead. So your example would be this:
DATETIME(2000,1,1,14,45)
It would take a little bit more manipulation of your "02:45 PM" value, but it is safer coding incase someone is using a different date format.

HTH
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform