SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2001
    Location
    Lahore, Punjab, Pakistan
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Change System Date and Time?

    Hi All!
    Currentl Im automating a feature of application that fetches the records in the database against the current date.
    How i can automate this featurei.e. Can i set system date or time so i can compare the results on different dates against the database?

    ------------------

  2. #2
    Junior Member
    Join Date
    May 2001
    Location
    New Delhi , India
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Change System Date and Time?

    Hi ,

    Please find below the 4Test Script which can be used to change the current date and time.

    -- CODE STARTS HERE --

    use "mswtype.inc";

    type SYSTEM_TIME is record
    {

    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
    }

    dll "kernel32.dll"
    {
    BOOL SetSystemTime( inout SYSTEM_TIME SystemDateTime );
    }

    testcase ChangeCurrentDateTime () appstate none
    {
    SYSTEM_TIME SystemDateTime;
    SystemDateTime.wYear = 2000;
    SystemDateTime.wMonth = 01;
    SystemDateTime.wDay = 10;
    SystemDateTime.wHour = 11;
    SystemDateTime.wMinute = 12;
    SystemDateTime.wSecond = 13;
    SystemDateTime.wMilliseconds = 14;
    SetSystemTime( SystemDateTime );
    }
    -- CODE END HERE --

    Cheers,

    Vishal Grover.




    ------------------

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    Lahore, Punjab, Pakistan
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Change System Date and Time?

    Thanks!
    Its a great Help!


    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:07 AM.

Copyright BetaSoft Inc.