Logo Search packages:      
Sourcecode: libical version File versions

char* icaltime_as_ical_string_r ( const struct icaltimetype  tt  ) 

Return a string represention of the time, in RFC2445 format. The string is owned by libical

Definition at line 458 of file icaltime.c.

{
    size_t size = 17;
    char* buf = icalmemory_new_buffer(size);

    if(tt.is_date){
      snprintf(buf, size,"%04d%02d%02d",tt.year,tt.month,tt.day);
    } else {
      const char* fmt;
      if(tt.is_utc){
          fmt = "%04d%02d%02dT%02d%02d%02dZ";
      } else {
          fmt = "%04d%02d%02dT%02d%02d%02d";
      }
      snprintf(buf, size,fmt,tt.year,tt.month,tt.day,
             tt.hour,tt.minute,tt.second);
    }
    
    return buf;
}


Generated by  Doxygen 1.6.0   Back to index