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
always returns the following:Code:int main () { time_t *current; time(current); printf("%s", ctime(current)); return 0; }
Thu Jan 1 01:00:00 1970
the following program:
always returns: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; }
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....



LinkBack URL
About LinkBacks


