C Program to get Current Time

Posted: 28th July 2010 by Ravi Chopra in C Programs

This program reads the current system time and displays it in the form HH:MM:SS

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

int main(void)

{
struct time t;
gettime(&t);
printf(“The current time is: %2d:%02d:%02dn”, t.ti_hour, t.ti_min, t.ti_sec);
return 0;
}

People who read this also read:

  • No Related Posts

http://learnhacking.in/c-program-to-get-current-time/
  1. Couldnt agree more with that, very attractive article

  2. My partner and I really enjoyed reading this blog post, I was just itching to know do you trade featured posts? I am always trying to find someone to make trades with and merely thought I would ask.

  3. Wow this is a great resource.. I’m enjoying it.. good article

  4. Hi webmaster and commenters ! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep ‘em coming… you all do such a great job at such Concepts… can’t tell you how much I, for one appreciate all you do!

  5. You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.

  6. I recently came across this blog and have loved the content. I look forward to future articles and will definitely link to this and tell the people I know. Thanks.

  7. Toms Coupons says:

    You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.

  8. cigarettes says:

    Very useful information. Your blog is amazing, but I write often. Please post more often!

  9. rc says:

    your welcome:)