sorry for posting nearly directly but i doubt i would find the answer into so many posts returned by the search.... so,
linux date command on a shell return the date and time correctly... my following simple c program
Code:
int
main ()
{
time_t *current;
time(current);
printf("%s", ctime(current));
return 0;
}
always returns the following:
Thu Jan 1 01:00:00 1970
the following program:
Code:
int
main ()
{
time_t *current;
char dateStr[50];
time(current);
printf("%s", ctime(current));
strftime(dateStr, sizeof(dateStr), "%d/%m/%Y %Z", localtime(current));
printf("%s\n", dateStr);
return 0;
}
always returns:
Wed Apr 22 12:51:56 1970
22/04/1970 BST
can someone explain what is going on as i really have no clue why this is happening....