Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filename based on Datetime and Seconds
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01317041
Message ID:
01317088
Views:
9
>You Tom,
>
>You can use SECONDS() function to get time up to miliseconds. See help for details.
>
>? TTOC(DATETIME(),1) + PADL(INT(SECONDS()*100 % 100), 2, "0")
>
>

True, but I want the seconds that was at the moment that the TTOC(datetime(),1) was captured at.....

mytime = datetime()

? ttoc(mytime,1) to print CCYYMMDDhhmmss

but how to get the seconds ss part from the mytime??

*****************

Will this work?
lcDateTime =  TTOC(DATETIME(),1)

lcDecimalSeconds =   LEFT(RIGHT(ALLTRIM(STR(SECONDS(),10,3)),3),2)

? lcDateTime + lcDecimalSeconds
The Decimal Seconds part will probable not be the same as what the datetime was captured at, but I guess for my purposes, which is to get a file name created WHEN the file was created, is good enough.

Thanks!
Tommy Tillman A+ NetWork+ MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform