login about faq

CkDateTime::DiffSeconds returns 0 when it should have returned a negative value (according to the documentation):

CkDateTime ckdt1, ckdt2;
auto nSeconds1 = ckdt1.DiffSeconds(ckdt2); // nSeconds1 = 0
auto nSeconds2 = ckdt2.DiffSeconds(ckdt1); // nSeconds2 = 31622400

ckdt1 is obviously older than ckdt2, but does not return -31622400 as expected. No error is returned and put_VerboseLogging/put_DebugLogFilePath/lastErrorText does not indicate any issues.

This has been tested with version of Chilkat C/C++ Libs for VC++ 12.0 XP / win32.

By the way I am missing a simple method to compare dates. Maybe DiffSeconds was meant for that purpose, but counting the exact difference ought to be slower than to simply determine which is newer/older/equal.

asked Jun 12 '17 at 11:27

roan98dk's gravatar image


I made the fix, but can't produce a new build until late today or tomorrow. I'll post it here.

PS> DiffSeconds is valid for comparing dates. It's not slower than if a method returned true/false.


answered Jun 12 '17 at 16:12

chilkat's gravatar image

chilkat ♦♦


No rush. I won't replace the current build until the next scheduled release.

(Jun 12 '17 at 16:41) roan98dk

Thanks, I'll have a look..


answered Jun 12 '17 at 15:55

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 12 '17 at 11:27

Seen: 3,352 times

Last updated: Jun 13 '17 at 09:13

powered by OSQA