You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Florian Hockmann (JIRA)" <ji...@apache.org> on 2017/08/09 08:22:00 UTC

[jira] [Commented] (TINKERPOP-1745) Gremlin .NET: Use DateTimeOffset instead of DateTime to represent g:Date

    [ https://issues.apache.org/jira/browse/TINKERPOP-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16119562#comment-16119562 ] 

Florian Hockmann commented on TINKERPOP-1745:
---------------------------------------------

I never used {{DateTimeOffset}}, but according to [this article from the documentation|https://docs.microsoft.com/en-us/dotnet/standard/datetime/choosing-between-datetime] the main difference to {{DateTime}} is that it also includes an offset from UTC.
How would we get this offset when the GraphSON representation of {{g:Date}} looks like this?
{code}
{
  "@type" : "g:Date",
  "@value" : 1475583442552
}
{code}
Can we assume that the serialized values are always in UTC?

So my question is really only about the implementation. When we have a good solution then I agree that {{DateTimeOffset}} should be the default in Gremlin.Net. That's also in line with the recommendation in the linked article:
{quote}
These uses for DateTimeOffset values are much more common than those for DateTime values. As a result, DateTimeOffset should be considered the default date and time type for application development.
{quote}

> Gremlin .NET: Use DateTimeOffset instead of DateTime to represent g:Date
> ------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1745
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1745
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: language-variant
>            Reporter: Jorge Bay
>
> {{DateTimeOffset}} structure unambiguously identifies a single point in time, unlike {{DateTime}} which contains calendar information.
> I think we should use {{DateTimeOffset}} for the default representation of g:Date.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)