Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change system time\date

Posted on 1999-07-28
4
Medium Priority
?
135 Views
Last Modified: 2013-11-20
Could someone provide a code on how to change the systems time, and date?  Thanks.
0
Comment
Question by:Nitro187
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 240 total points
ID: 1311849
Simply call the SetSystemTime function.
0
 

Author Comment

by:Nitro187
ID: 1311850
I need an example though, I dont know how to use the "SetSystemTime"  function
0
 
LVL 23

Expert Comment

by:chensu
ID: 1311851
SYSTEMTIME tm;
tm.wYear = 1999;
tm.wMonth = 7;
tm.wDayOfWeek = 0;  // ignored
tm.wDay = 28;
tm.wHour = 0;
tm.wMinute = 0;
tm.wSecond = 0;
tm.wMilliseconds = 0;

::SetSystemTime(&tm);
0
 

Author Comment

by:Nitro187
ID: 1311852
thanks man
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question