Open topic with navigation

TIBCO ActiveSpaces® - Enterprise Edition 5.0.0

# temp_tibDateTime_ExcludeFromTOC

ActiveSpaces tables can be defined, using tibdg, with columns of type `datetime` that are mapped internally to a tibDateTime object for storing data into rows of the table. The following is the C API for setting and retrieving tibDateTime objects into/from the rows of a table:

    void tibdgRow_SetDateTime(tibEx e, tibdgRow row, const char *columnName, const tibDateTime *value)
    tibDateTime* tibdgRow_GetDateTime(tibEx e, tibdgRow row, const char* columnName)

tibDateTime columns can be used for primary keys and for secondary indexes.

## Populating tibDateTime

Windows and Unix platforms use different structures for retrieving date/time data. The following are examples of how you can get the current date and time on each platform and populate a tibDateTime object:

Unix platforms

    #include <sys/types.h>
    #include <sys/time.h>
    #include “tibdg/tibdg.h”

    struct timeval    timebuffer;
    (void) gettimeofday(&timebuffer, NULL);

    tibDateTime dt;
    dt.sec  = timebuffer.tv_sec;
    dt.nsec = timebuffer.tv_usec * 1000;

Windows

    #include <sys/timeb.h>
    #include “tibdg/tibdg.h”

    truct __timeb64 timebuffer;
    ftime64_s(&timebuffer);

    ibDateTime dt;
    t.sec  = timebuffer.time;
    dt.nsec = timebuffer.millitm * 1000000;

The ActiveSpaces API can then be used to store the tibDateTime object into a row that is then stored into a table in the data grid.

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 ActiveSpaces® - Enterprise Edition

Copyright © 2009-2025. Cloud Software Group, Inc. All Rights Reserved.