Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datetime conversion solution
Message
From
13/10/2005 11:55:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/10/2005 11:43:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01058733
Message ID:
01058735
Views:
12
>somebody clear my mind. I'm doing an application with timed event. This is pre-configure and saved in a *.mem file.
>I have a spinner control for inputting the time, so if the user set this to 12:45AM im saving it as 45(N) in a memory variable.
>The code for the timer scenario will be at everyday at this hour with an allowance time for checking like 10 minutes after the default time.
>My code should be look like this
> IF between(datetime(), nDefaultTime, (nDefaultTime + 10))
> .. do some processing
> ELSE
> .. do nothing
> ENDIF
>
>My real problem here is to how to convert the nDefaultTime to a datetime format so I can compare it to the datetime(). Please enlighten me.
>How can I convert my 45(N) to a datetime field, any ideas? TIA!

ltTime = ctot('0:'+ltrim(str(45)))
lt10MinsLater = ltTime + 10 * 60

PS: If date component is important:
ltTime = Dtot(Date()) + (ctot('0:'+ltrim(str(45)))-Ctot('0'))

or is this what you're looking for?
ltTime = Dtot(Date()) + 45 * 60
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform