Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: M. Tanveer Ul Hassan Shaheen
  Where is M. Tanveer Ul Hassan Shaheen?
 Rahim Yar Khan
 Pakistan
 M. Tanveer Ul Hassan Shaheen
 To: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 Tags
Subject: RE: Set date programmatically - HOWTO?
Thread ID: 331190 Message ID: 331195 # Views: 39 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Network and Computer Management
Date: Tuesday, December 27, 2011 6:03:38 PM         
   


> Colleagues,
>
> Suppose you need to test some program that manages the period data, say - for the month of January, February, etc., and it determines this periood by the today's date's month (i.e., December, like - now), and you need to test it for another month.
>
> IOW, if it's today (December) - then your program would pick up the data (by the date field in a table) for November.
>
> However, you need to have your system date set to January temporarily.
>
> Besides the obvious move (changing the system date on your PC by clicking on that date/time pad in the right corner of the Task Bar) - is there any way to set the date programmatically in VFP? (Needless to say that I'd like to move the system date in a test launcher program, and resore it back to the today's date at the end of this launcher program.)
>
> Any ideas?
>
> TIA!
>
> Regards,
>
> Ilya


set textmerge on to c:\changedate.bat noshow
\ date 27-12-2011
set textmerge to
WshShell = CreateObject("WScript.Shell")
ReturnCode = WshShell.Run("c:\changedate.bat", 0, .t.)
erase c:\changedate.bat


Thanks & Regards
Tanveer Ul hassan

ENTIRE THREAD

Set date programmatically - HOWTO? Posted by Ilya Rabyy @ 12/27/2011 5:11:33 PM
RE: Set date programmatically - HOWTO? Posted by M. Tanveer Ul Hassan Shaheen @ 12/27/2011 6:03:38 PM
RE: Set date programmatically - HOWTO? Posted by Luis Maria Guayan @ 12/27/2011 6:18:37 PM
RE: Set date programmatically - HOWTO? Posted by Ilya Rabyy @ 12/27/2011 6:37:57 PM
RE: Set date programmatically - HOWTO? Posted by Pete Sass @ 12/27/2011 6:29:12 PM