Open topic with navigation

TIBCO Rendezvous® 8.7.0

# Add DateTime

Convenience Function

## Declaration

    tibrv_status tibrvMsg_AddDateTime(
      tibrvMsg                message,
      const char*             fieldName,
      const tibrvMsgDateTime*  value);
    tibrv_status tibrvMsg_AddDateTimeEx(
      tibrvMsg                 message,
      const char*              fieldName,
      const tibrvMsgDateTime*  value,
       tibrv_u16               fieldId);

## Purpose

Add a field containing a Rendezvous datetime value.

Parameter | Description
`message` | Add the new field to this message.
`fieldName` | Create the new field with this name.
`value` | Add a new field that contains this datetime value. The function copies the data into the new message field.
`fieldId` | Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a `NULL` field name, and a non-zero field identifier.

## Example

This example code fragment converts a `time_t` value to a datetime value, and adds the datetime to a message field. Programs can adapt this example as appropriate. (For corresponding code to extract a datetime value from a message field, and convert it to a `time_t` value, see the example at Get DateTime.)

    #include <limits.h>
    tibrv_status
    addAsTimeT(tibrvMsg msg,
            const char * field,
            time_t value)
    {   tibrvMsgDateTime d;
        d.nsec = 0;
        d.sec = (tibrv_i64) value;
        return tibrvMsg_AddDateTime(msg, field, &d); }

## See Also

tibrvMsgDateTime

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.