Results 1 to 3 of 3
  1. #1
    Guest

    Default Getting the date and time in C

    Does anyone know how to get the date and time in C and then print it out to the screen?

  2. #2
    Guest

    Default Re: Getting the date and time in C

    I haven't tried it but K&R says the functions are declared in time.h

  3. #3
    Guest

    Default Re: Getting the date and time in C

    #include<time.h>
    #include<stdio.h>

    int main(void)
    {
    time_t timer;

    timer=time(NULL);
    printf('The current time is %s\n',asctime(localtime(&timer)));
    return 0;
    }

Similar Threads

  1. Excel date & time
    By nodrog in forum PressF1
    Replies: 1
    Last Post: 02-10-2005, 01:38 PM
  2. Email Date and Time
    By mikestew in forum PressF1
    Replies: 2
    Last Post: 26-07-2003, 03:07 PM
  3. XP Time/date
    By Poppa John in forum PressF1
    Replies: 2
    Last Post: 01-08-2002, 04:57 PM
  4. date/time
    By in forum PressF1
    Replies: 0
    Last Post: 10-11-2000, 08:57 AM
  5. Date and Time
    By in forum PressF1
    Replies: 0
    Last Post: 28-07-2000, 03:24 PM

Posting Permissions

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