From 87ce55d13d6145d3a1bee36648c0217ac3a4f7e9 Mon Sep 17 00:00:00 2001 From: Boyan Penev Date: Wed, 19 Jul 2023 17:35:34 +1000 Subject: [PATCH] Fixing a rounding issue when converting to Julian date --- .../2B_ExportSourceDataToParquet/Export-ParquetSharp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Migration/SQLServer/2B_ExportSourceDataToParquet/Export-ParquetSharp.ps1 b/Migration/SQLServer/2B_ExportSourceDataToParquet/Export-ParquetSharp.ps1 index 03910aa..a795b41 100644 --- a/Migration/SQLServer/2B_ExportSourceDataToParquet/Export-ParquetSharp.ps1 +++ b/Migration/SQLServer/2B_ExportSourceDataToParquet/Export-ParquetSharp.ps1 @@ -151,7 +151,7 @@ Function Get-Int96Pieces { $Month = $Month + 12; $Year = $Year - 1; } - $c = [math]::Floor($Day + (153 * $Month - 457) / 5 + 365 * $Year + ($Year / 4) - ($Year / 100) + ($Year / 400) + 1721119) + $c = $Day + [math]::Floor((153 * $Month - 457) / 5) + 365 * $Year + [math]::Floor($Year / 4) - [math]::Floor($Year / 100) + [math]::Floor($Year / 400) + 1721119 } else { $c = 2440589 # 1/2/1970 constant }