DateDiff issue in Windows 11

%3CLINGO-SUB%20id%3D%22lingo-sub-3014569%22%20slang%3D%22en-US%22%3EDateDiff%20issue%20in%20Windows%2011%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3014569%22%20slang%3D%22en-US%22%3E%3CP%3ERunning%20Visual%20Studio%202019%20in%20Windows%2011%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIssue%20with%20DateDiff%20-%20the%20issue%20appears%20to%20start%20to%20return%20an%20error%20date%20from%2024th%20October%201999.%20If%20we%20start%20with%20a%20base%20date%20of%2031st%20December%201967%20(Pick%20iConv%20date)%20and%20add%20a%20specified%20amount%20of%20days%2C%20the%20returning%20date%20is%20incorrect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESample%20code%20to%20prove%20the%20issue%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Result%3DDateAdd(DateInterval.Day%2C%2011620%2C%20DateSerial(1967%2C%2012%2C%2031))%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20'Returns%2010%2F24%2F1999%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Result%3DDateAdd(DateInterval.Day%2C%2011621%2C%20DateSerial(1967%2C%2012%2C%2031))%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20'Returns%2010%2F24%2F1999%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThereafter%20the%20result%20is%20always%20at%20least%20one%20day%20out%20of%20the%20expected%20sequence.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFurthermore%20if%20you%20run%20the%20following%20difference%20in%20days%2C%20it%20returns%20these%20results%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E19673%20-%2011%2F10%2F2021%3CBR%20%2F%3E19674%20-%2011%2F10%2F2021%3CBR%20%2F%3E19675%20-%2011%2F11%2F2021%3CBR%20%2F%3E19676%20-%2011%2F13%2F2021%3CBR%20%2F%3E19677%20-%2011%2F14%2F2021%3CBR%20%2F%3E19678%20-%2011%2F15%2F2021%3CBR%20%2F%3E19679%20-%2011%2F15%2F2021%3CBR%20%2F%3E19680%20-%2011%2F16%2F2021%3CBR%20%2F%3E19681%20-%2011%2F17%2F2021%3CBR%20%2F%3E19682%20-%2011%2F19%2F2021%3CBR%20%2F%3E19683%20-%2011%2F20%2F2021%3CBR%20%2F%3E19684%20-%2011%2F21%2F2021%3CBR%20%2F%3E19685%20-%2011%2F21%2F2021%3CBR%20%2F%3E19686%20-%2011%2F22%2F2021%3CBR%20%2F%3E19687%20-%2011%2F24%2F2021%3CBR%20%2F%3E19688%20-%2011%2F25%2F2021%3CBR%20%2F%3E19689%20-%2011%2F26%2F2021%3CBR%20%2F%3E19690%20-%2011%2F26%2F2021%3CBR%20%2F%3E19691%20-%2011%2F27%2F2021%3CBR%20%2F%3E19692%20-%2011%2F28%2F2021%3CBR%20%2F%3E19693%20-%2011%2F30%2F2021%3CBR%20%2F%3E19694%20-%2012%2F01%2F2021%3CBR%20%2F%3E19695%20-%2012%2F02%2F2021%3CBR%20%2F%3E19696%20-%2012%2F02%2F2021%3CBR%20%2F%3E19697%20-%2012%2F03%2F2021%3CBR%20%2F%3E19698%20-%2012%2F04%2F2021%3CBR%20%2F%3E19699%20-%2012%2F06%2F2021%3CBR%20%2F%3E19700%20-%2012%2F07%2F2021%3CBR%20%2F%3E19701%20-%2012%2F07%2F2021%3CBR%20%2F%3E19702%20-%2012%2F08%2F2021%3CBR%20%2F%3E19703%20-%2012%2F09%2F2021%3CBR%20%2F%3E19704%20-%2012%2F11%2F2021%3CBR%20%2F%3E19705%20-%2012%2F12%2F2021%3CBR%20%2F%3E19706%20-%2012%2F13%2F2021%3CBR%20%2F%3E19707%20-%2012%2F13%2F2021%3CBR%20%2F%3E19708%20-%2012%2F14%2F2021%3CBR%20%2F%3E19709%20-%2012%2F15%2F2021%3CBR%20%2F%3E19710%20-%2012%2F17%2F2021%3CBR%20%2F%3E19711%20-%2012%2F18%2F2021%3CBR%20%2F%3E19712%20-%2012%2F19%2F2021%3CBR%20%2F%3E19713%20-%2012%2F19%2F2021%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Running Visual Studio 2019 in Windows 11

 

Issue with DateDiff - the issue appears to start to return an error date from 24th October 1999. If we start with a base date of 31st December 1967 (Pick iConv date) and add a specified amount of days, the returning date is incorrect.

 

Sample code to prove the issue:

 

      Result=DateAdd(DateInterval.Day, 11620, DateSerial(1967, 12, 31))

      'Returns 10/24/1999

 

      Result=DateAdd(DateInterval.Day, 11621, DateSerial(1967, 12, 31))

      'Returns 10/24/1999

 

Thereafter the result is always at least one day out of the expected sequence.

 

Furthermore if you run the following difference in days, it returns these results:

 

19673 - 11/10/2021
19674 - 11/10/2021
19675 - 11/11/2021
19676 - 11/13/2021
19677 - 11/14/2021
19678 - 11/15/2021
19679 - 11/15/2021
19680 - 11/16/2021
19681 - 11/17/2021
19682 - 11/19/2021
19683 - 11/20/2021
19684 - 11/21/2021
19685 - 11/21/2021
19686 - 11/22/2021
19687 - 11/24/2021
19688 - 11/25/2021
19689 - 11/26/2021
19690 - 11/26/2021
19691 - 11/27/2021
19692 - 11/28/2021
19693 - 11/30/2021
19694 - 12/01/2021
19695 - 12/02/2021
19696 - 12/02/2021
19697 - 12/03/2021
19698 - 12/04/2021
19699 - 12/06/2021
19700 - 12/07/2021
19701 - 12/07/2021
19702 - 12/08/2021
19703 - 12/09/2021
19704 - 12/11/2021
19705 - 12/12/2021
19706 - 12/13/2021
19707 - 12/13/2021
19708 - 12/14/2021
19709 - 12/15/2021
19710 - 12/17/2021
19711 - 12/18/2021
19712 - 12/19/2021
19713 - 12/19/2021

0 Replies