SYNOPSIS

#include <bson.h>

bool
bson_append_date_time (bson_t     *bson,
                       const char *key,
                       int         key_length,
                       int64_t     value);

bool
bson_append_time_t (bson_t     *bson,
                    const char *key,
                    int         key_length,
                    time_t      value);

bool
bson_append_timeval (bson_t         *bson,
                     const char     *key,
                     int             key_length,
                     struct timeval *value);

DESCRIPTION

The bson_append_date_time() function shall append a new element to a bson document containing a date and time with no timezone information. value is assumed to be in UTC format of milliseconds since the UNIX epoch. value may be negative.

The bson_append_timeval() function is a helper that takes a struct timeval instead of milliseconds since the UNIX epoch.

The bson_append_time_t() function is a helper that takes a time_t instead of milliseconds since the UNIX epoch.

RETURN VALUE

TRUE is returned if successful. Otherwise FALSE.

ERRORS

FALSE is returned if there was not sufficient space to append the element.

SEE ALSO

AUTHORS

This page was written by MongoDB, Inc.