Ctime Function

  • It is used for returning a time in string, whose form is : day month year hours : minutes : seconds year .

    Syntax:

     char *ctime(const time_t *time);
    
    

    Example:

    #include <time.h>
    
      #include <stdio.h>
    
      int main()
    
      {
    
        time_t l;
    
        l = time(NULL);
    
        printf(ctime(&l));
    
        return 0;
    
      }  
    Back