
TX/MAM Database Protocol Manual - document version: 2.2 – Page 31
10.2 Converting human readable time and date string to a Cobalt time
field
int cob_timedate_to_msec( char *time, char *date, long long *time_date_msec );
Parameters
The time part as a string, e.g. "13:00:00:00".
The date part as a string, e.g. "2006-10-06".
long long
*time_date_msec
The resulting Cobalt time field.
Result
The result of the function is an integer that can have following values:
Success, the time could be converted.
Failure, the time could not be converted.
Example
Converting a human readable time and date to a Cobalt time field:
cob_msec_to_timedate( "13:00:00:00", "2006-10-06" , mainevent_datetime );
cob_fieldlist_clear();
cob_fieldlist_set_long( "start_datetime", mainevent_datetime, ORIGINAL_DATA );
if ( cob_adjust_field_values( "main_event", 1035 ) != 0 ){
/* Log error */
}
Comentarios a estos manuales