Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extracting the Date & Time from a DATETIME field
Message
From
25/02/2006 06:39:04
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01098831
Message ID:
01099160
Views:
28
Sorry, I remembered wrong. However, you can use the TTOC function to get the time portion.
Date=TTOD(datetime)
Date=TTOC(datetime,2)
>Tore, TIME() always gives the current, whether it has a paremeter in it or not, and the parameter should be a numeric value.
>You cannot extract the time portion of any datetime vartiables using TIME(), you have to substring it.
>
>>>Can anybody tell how I can extract the date and time from a datetime field. For example I have a record which in the created field states: 17/02/2006 09:57:42 AM.
>>>
>>>I would like to store 17/02/2006 to a variable and 09:57:42 to another variable
>>>
>>>Any help would greatly appreciated
>>Date=TTOD(datetime)
>>Time=TIME(datetime)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform