You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Igor Sapego (JIRA)" <ji...@apache.org> on 2016/02/09 11:52:18 UTC
[jira] [Commented] (IGNITE-2222) CPP: Implement Date data type
support for binary protocol.
[ https://issues.apache.org/jira/browse/IGNITE-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15138776#comment-15138776 ]
Igor Sapego commented on IGNITE-2222:
-------------------------------------
It seems that Java {{Date}} type is actually a number of *milliseconds* since epoch (i.e. January 1, 1970, 00:00:00 GMT) stored as an 64-bit integer. Unfortunately, there are no time types in C++ standard library except for C++11 Chrono library, which is not supported by VS 2010 which we need to support. However, there is C time library which has {{time_t}} type. Unfortunately, this type's structure and content is implementation-specific, though it is generally implemented as an integral value representing the number of *seconds* elapsed since epoch.
So here is proposed solution - add {{ignite::Date}} type, that would contain milliseconds since epoch inside. This way we can store Java {{Date}} without losing precision and we still can use it in C++ using standard C library functions if we convert milliseconds to seconds which is trivial.
> CPP: Implement Date data type support for binary protocol.
> ----------------------------------------------------------
>
> Key: IGNITE-2222
> URL: https://issues.apache.org/jira/browse/IGNITE-2222
> Project: Ignite
> Issue Type: Bug
> Components: platforms
> Reporter: Igor Sapego
> Assignee: Igor Sapego
>
> It is needed to implement {{Date}} data type support because some SQL queries return data of that type and we need to be able to deserialize it on the C++ client side.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)