This is just from a first glance, but in the part where you right to the file, the %c should be a %s to specify string, and since date is the char array, you should pass date in without any indices, since date by itself is the pointer to the first element in the array.
fprintf(file_handle,"
%s\n", 
date);
Hope this helps
Bilal Durrani
NI 
					
				
			
			
				
	Bilal Durrani
NI