Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the datetime to a time in the future
Message
From
23/05/2006 10:24:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/05/2006 05:45:19
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:
01124202
Message ID:
01124250
Views:
11
>>I have a datetime field named scheduled. I would like to replace the contents of the field with the next time the clock is 9 a.m in the morning. So if the datetime were say 23/05/2006 10:36:42
>>I would like to replace the value with 24/05/2006 09:00:00.
>>
>>Can anybody help me please?
>>
>>Thanks
>
>?Datetime() -Seconds() + (33*60*60)

Methinks this will work if the clock is after 9:00 a.m., but not if it is before 9:00 a.m. (in which case, according to the statement, it seems he wants 9:00 a.m. of the same day, not of the next day). In this case, perhaps a few additional conditions would be appropriate.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform