Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Could not find it in the Help
Message
From
21/04/2005 14:11:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01007154
Message ID:
01007164
Views:
16
>I'm trying to find a correct format for strict datetime values, but I could not find it. Would you please check, if the following code creates this correctly?
>
>********************************************************************
>*  Description.......: TimeToStr - creates a date string from date
>*  Calling Samples...:
>*  Parameter List....: ttTime
>*  Created by........: Nadya Nosonovsky 07/13/2001 02:52:32 PM
>*  Modified by.......:
>********************************************************************
>function TimeToStr
>lparameter ttTime
>local lcReturn
>if empty(m.ttTime)
>	lcReturn='{}'
>else
>	lcReturn="{^" + (transform(ttoc(m.ttTime,1), "@R 9999/99/99 99:99:99")) + "}"
>endif
>return m.lcReturn


That would work but you are not validating the parameter to other than empty. It should validate to accept a DateTime parameter, else your TTOC() will fail.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform