beautypg.com

Date & time functions – Grass Valley K2 TX/MAM Database Protocol Manual v.2.2 User Manual

Page 30

background image

TX/MAM Database Protocol Manual - document version: 2.2

– Page 30

10.

Date & time functions

Use following functions to work with the time and date formats as used in Cobalt.

10.1 Converting a Cobalt time field to two strings containing resp. the

time and date part

int cob_msec_to_timedate( long long time_date_msec, char *time, char *date );



Parameters

Name

Description

long long
time_date_msec

The Cobalt time field to convert.

char *time

The time part as a string, e.g. "13:00:00:00".

char *date

The date part as a string, e.g. "2006-10-06".



Result
The result of the function is an integer that can have following values:

Value

Description

0

Success, the time could be converted.

-1

Failure, the time could not be converted.



Example
Converting a start time to human readable format:

cob_msec_to_timedate( mainevent_datetime, time, date );

printf( "Main Event starts at %s, %s", time, date );