forked from msgpack/msgpack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDateTimeMemberConversionMethod.cs
More file actions
72 lines (67 loc) · 2.6 KB
/
DateTimeMemberConversionMethod.cs
File metadata and controls
72 lines (67 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2015 FUJIWARA, Yusuke
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion -- License Terms --
using System;
namespace MsgPack.Serialization
{
/// <summary>
/// Defines behavior of built-in serializers to conversion of <see cref="DateTime"/> value for specific member.
/// </summary>
public enum DateTimeMemberConversionMethod
{
/// <summary>
/// Uses systems default <see cref="DateTimeConversionMethod"/> value.
/// </summary>
/// <remarks>
/// The systems default <see cref="DateTimeConversionMethod.Native"/>.
/// </remarks>
Default = 0,
/// <summary>
/// Uses <see cref="DateTime.Ticks"/> context, that is, Gregorian 0000-01-01 based, 100 nano seconds resolution. This value also preserves <see cref="DateTimeKind"/>.
/// </summary>
/// <remarks>
/// As of 0.6, this value has been become default. This option prevents accidental data loss.
/// </remarks>
Native = 1,
/// <summary>
/// Uses Unix epoc context, that is, Gregirian 1970-01-01 based, milliseconds resolution.
/// </summary>
/// <remarks>
/// Many binding such as Java uses this resolution, so this option gives maximom interoperability.
/// </remarks>
UnixEpoc = 2,
/// <summary>
/// Uses MsgPack timestamp format, that is, Gregirian 1970-01-01 based, nanoseconds resolution, with reserved ext type format.
/// </summary>
/// <remarks>
/// <para>
/// As of 1.0, this value became default.
/// </para>
/// <para>
/// This is best choice for interoperability and prevents accidental data loss, but old implementation does not recognize this type.
/// For backward compability purposes, use <see cref="Native"/> or <see cref="UnixEpoc"/> instead.
/// </para>
/// <para>
/// Note that <see cref="DateTime"/> and <see cref="DateTimeOffset"/> cannot hold nanoseconds value.
/// If you can depend on this assembly, consider <see cref="Timestamp"/> for date-time typed members to maximize interoperability for other languages.
/// </para>
/// </remarks>
Timestamp = 3
}
}