title: convert a long number to date , time in C
body: <p>i am solving spoj problem
  where current time stamp is sqaured and then divided by 400000007 and the remainder is converted into a dat time
  below is the technique i used..</p>
  
  <pre><code>remainder = result%4000000007 ; 
  
  printf("%ul\n",remainder); 
  
  
  //convert the timestamp into date , time 
  
  dt = localtime(&amp;remainder); 
  // use any strftime format spec here 
  // strftime(b, sizeof(b), "%m%d%H%M%y", dt); 
  // fprintf(stdout, "%s", b); 
  // printf("%s\n",asctime(localtime(&amp;remainder))); 
   ltime = (time_t)remainder; 
   printf("%s\n",asctime(dt)); 
   printf("%s\n",ctime(&amp;ltime));
  </code></pre>
  
  <p>Error shown is Segmentation fault , at <code>asctime</code> , also <code>ltime</code> is time_t variable ,'b' is a buffer ,  <code>dt</code> is struct tm * , and also i have tried to convert the remainder into <code>time_t</code> variable , but still dint work . Also , Commented code shows my attempts .
  Using debugger , i found asctime returns null .</p>
  
  <p>where is the problem ?</p>