Skip to content

Commit 419d45f

Browse files
authored
Merge pull request #302 from msgpack/fix/#296
Fix Timestamp conversion
2 parents ead1f72 + 7330d50 commit 419d45f

14 files changed

+429
-11
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,8 @@ Release 1.0.0 2018-6-14
753753
* Fix map keys order emitted by asymmetric (serialization only) serializer are inconsistent across platform.
754754
* Fix Unity build does not honor serialization related attributes correctly.
755755
* Fix internal inconsitency between serialization related attributes detection and their parameter retrieval.
756+
757+
Release 1.0.1 2018-09-09
758+
759+
BUG FIXES
760+
* Fix conversion from DateTime[Offset] to Timestamp failure for before Unix epoc. #296

appveyor-release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ image: Visual Studio 2017
33
branches:
44
only:
55
- master
6-
- 0.7
7-
- 0.8
8-
- 0.9
6+
- /[0-9]+\.[0-9]+(\.[xX])?/
97
configuration: Release
108
assembly_info:
119
patch: true

build/Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if ( $buildConfig -eq 'Release' )
158158
{
159159
Write-Host "Build NuGet packages..."
160160

161-
& $msbuild ../src/MsgPack/MsgPack.csproj /t:pack /v:minimal /p:Configuration=$buildConfig /p:IncludeSource=true /p:NuspecProperties=version=$env:PackageVersion
161+
& $msbuild ../src/MsgPack/MsgPack.csproj /t:pack /v:minimal /p:Configuration=$buildConfig /p:IncludeSource=true /p:IncludeSymbols=true /p:NuspecProperties=version=$env:PackageVersion
162162

163163
Move-Item ../bin/*.nupkg ../dist/
164164
Copy-Item ../bin/* ./MsgPack-CLI/ -Recurse -Exclude @("*.vshost.*")

src/MsgPack/Timestamp.Conversion.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ private static void FromOffsetTicks( long ticks, out long unixEpocSeconds, out i
133133
long remaining;
134134
unixEpocSeconds = DivRem( ticks, SecondsToTicks, out remaining );
135135
nanoSeconds = unchecked( ( int )remaining ) * 100;
136+
if ( nanoSeconds < 0 )
137+
{
138+
// In this case, we must adjust these values
139+
// from "negative nanosec from nearest larger negative integer"
140+
// to "positive nanosec from nearest smaller nagative integer".
141+
unixEpocSeconds -= 1;
142+
nanoSeconds = ( MaxNanoSeconds + 1 ) + nanoSeconds;
143+
}
136144
}
137145

138146
/// <summary>

test/MsgPack.UnitTest.BclExtensions.WinRT/MsgPack.UnitTest.BclExtensions.WinRT.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
<PackageCertificateKeyFile>MsgPack.UnitTest.BclExtensions.WinRT_TemporaryKey.pfx</PackageCertificateKeyFile>
1616
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
1717
<RestorePackages>true</RestorePackages>
18-
<PackageCertificateThumbprint>34322AD6CF171CC843FCCE936CB6B9B616B961E1</PackageCertificateThumbprint>
18+
<PackageCertificateThumbprint>AA68CFB533B03B5B4FAD8AE85A404BD5936CB7C7</PackageCertificateThumbprint>
1919
<TargetPlatformVersion>8.1</TargetPlatformVersion>
2020
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
2121
<TargetFrameworkVersion />
2222
<AppxBundle>Never</AppxBundle>
2323
</PropertyGroup>
2424
<Import Project="..\..\MsgPack.Common.props" />
2525
<PropertyGroup>
26-
<DocumentationFile></DocumentationFile>
26+
<DocumentationFile>
27+
</DocumentationFile>
2728
<DefineConstants>$(DefineConstants);NETFX_CORE;NETSTANDARD1_1;FEATURE_TAP;MSTEST</DefineConstants>
2829
<NoWarn>;2008</NoWarn>
2930
</PropertyGroup>
Binary file not shown.

test/MsgPack.UnitTest.Uwp.Aot/MsgPack.UnitTest.Uwp.Aot.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<PackageCertificateKeyFile>MsgPack.UnitTest.Uwp.Aot_TemporaryKey.pfx</PackageCertificateKeyFile>
1616
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">14.0</UnitTestPlatformVersion>
17-
<PackageCertificateThumbprint>C125CA52683091C62F7746FF9A159E44B2A18673</PackageCertificateThumbprint>
17+
<PackageCertificateThumbprint>880646284800F8F3356B8C7E3E734562D8BB304F</PackageCertificateThumbprint>
1818
</PropertyGroup>
1919
<Import Project="..\..\MsgPack.Common.props" />
2020
<PropertyGroup>
Binary file not shown.

test/MsgPack.UnitTest.Uwp/MsgPack.UnitTest.Uwp.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<PackageCertificateKeyFile>MsgPack.UnitTest.Uwp_TemporaryKey.pfx</PackageCertificateKeyFile>
1616
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">14.0</UnitTestPlatformVersion>
17-
<PackageCertificateThumbprint>0CEFF2E3DC6DD3A7245B2FB641B6DE056C5A79D9</PackageCertificateThumbprint>
17+
<PackageCertificateThumbprint>807856C98966D121CA69C33F7D6475CF03AA8633</PackageCertificateThumbprint>
1818
</PropertyGroup>
1919
<Import Project="..\..\MsgPack.Common.props" />
2020
<PropertyGroup>
21-
<DocumentationFile></DocumentationFile>
21+
<DocumentationFile>
22+
</DocumentationFile>
2223
<DefineConstants>$(DefineConstants);NETFX_CORE;WINDOWS_UWP;NETSTANDARD1_3;FEATURE_TAP</DefineConstants>
2324
<NoWarn>;2008</NoWarn>
2425
<SignAssembly>false</SignAssembly>
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)