0

Are there any functions built in C to display the current time and date, and if there is could someone display its syntax
Thanks.....

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by ChrisXxX
0

Yea I know but could u give me an example as to how you would display to the screen.
Ex: The current date is 07/04/210.

0

Yea I know but

Well, if you knew they were there, then why did you ask if there were any functions?


how you would display to the screen. Ex: The current date is 07/04/210.

um, okay...

printf("Ex: The current date is 07/04/210.");

Edited by jephthah: n/a

0

lol no, I mean the use of some function to retrieve the date from the host computer internal system and display it to the screen

1

man, you're starting to sound helpless. the link i gave you gives every single time.h function and prototype. a basic search will find examples such as this:

/* localtime example */
#include <stdio.h>
#include <time.h>

int main ()
{
  time_t rawtime;
  struct tm * timeinfo;

  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  printf ( "Current local time and date: %s", asctime (timeinfo) );
  
  return 0;
}
0

Sorry to sound so help less but I was jus clueless there anyways thanks man

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.