login about faq

Using the GetAsDosDate in the CkDateTime class in the ActiveX version of the Chilkat library (not sure about other versions) does not work correctly. When I use SetFromCurrentSystemTime to set the time and them use GetAsDosDate(1) and GetAsDosDate(0), the first one is supposed to be based on local time, and the second one should return a value based on GMT. However they return identical values. In my test, here's the date and time in normal VB6 format returned from the VB6 Now function: 11/23/2014 5:57:41 PM

Here's the value returned from GetAsDosDate(1): 1165463349

Here's the value returned from GetAsDosDate(0): 1165463349

And further more, my test also had a to extract the hour that's encoded in the DosDate value. The General function is (GetAsDosDate(1) 2048) AND 31, where " 2048" is an integer division and is equivalent to a bitshift to the right by 11 bits. And "AND 31" is a 5 bit mask. My test program used it twice, once in conjunction with GetAsDosDate(1), and once in conjunction with GetAsDosDate(0). The results are as seen below.

Here's the value returned from (GetAsDosDate(1) 2048) AND 31: 17

Here's the value returned from (GetAsDosDate(0) 2048) AND 31: 17

It shows the same hour, even though GMT is supposed to be 8 hours more than the local time version, which would be (17 + 8) Mod 24 = 1. But intead of the GMT hour showing as 1, it showed as 17, the same as local time.

Please fix this in the next version of your Chilkat ActiveX DLL

asked Nov 23 '14 at 21:08

Ben%20Hutchinson's gravatar image

Ben Hutchinson

edited Nov 23 '14 at 21:10

I've confirmed this issue here too in - GetAsUnixTime, GetAsOleDate, and GetAsRfc822 all seem to work properly, but GetAsDosDate returns the same values no matter what the bLocal parameter value.

(Nov 23 '14 at 21:30) jpbro ♦


answered Nov 25 '14 at 11:55

chilkat's gravatar image

chilkat ♦♦


I just tried it out. It does work now.

(Nov 26 '14 at 13:19) Ben Hutchinson

Thanks! I'll have a look and will post a pre-release download with the fix as soon as possible.


answered Nov 24 '14 at 11:04

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: Nov 23 '14 at 21:08

Seen: 656 times

Last updated: Nov 26 '14 at 13:19

powered by OSQA