Home » C SOURCE CODES

C Program to Set/Change the Current System Date

Submitted by Srikanth on Wednesday, 16 January 20084 Comments

This program can be used to set the system date or to change the current system date.

#include <stdio.h>
#include <process.h>
#include <dos.h>

int main(void)
{
struct date reset;
struct date save_date;
getdate(&save_date);
printf(“Original date:\n”);
system(“date”);
reset.da_year = 2001;
reset.da_day = 1;
reset.da_mon = 1;
setdate(&reset);
printf(“Date after setting:\n”);
system(“date”);
setdate(&save_date);
printf(“Back to original date:\n”);
system(“date”);
return 0;
}

Popularity: 2% [?]

Visitors who read this post, also read:

  1. Hack Software and Run the Trial Program Forever

  By using/following this site you agree to our Legal Disclaimer

Subscribe to GoHacking.Com


Enjoyed this article?
Subscribe to GO HACKING and get daily updates in your email for free

4 Comments »

  • biswajit das said:

    Hi
    i am impressed ur given code. so now i want to need c code using i want to delete the different exe file from windows xp. so plz send me code in my email.
    email [email protected]

  • Virendra said:

    hi Shrikant,
    can you please tell me from where can i get c compiler

  • dipan said:

    hey can u give me answer to the problem:
    i enter string and want to replace all a’s,b’s,c’s with 1,2,3
    d’s,e’s,f’s with 11,12,13
    g’s,h’s,i’s with 111,112,113 and so on….

  • Srikanth (author) said:

    @ dipan

    I don’t understand your problem. Plz be clear

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.