login about faq

I'm noticing a behavior where the GetDt method on CkoDateTime will return the current Date / Time if the Date header is missing or incomprehensible (such as: "Date: Tue Apr 05 15:14:01 -0700 2011"). Is this expected behavior? I noticed that other headers "Received" and "X-Apparently-To" headers do have dates in them, at least in a couple of the examples I've seen.

This is a real problem for me.

asked Mar 01 at 11:46

scottag's gravatar image

scottag
1


Unfortunately, yes, this is the expected behavior. The problem is that some actual date must be returned, and it must be valid. This behavior originated because returning invalid dates caused some systems (.NET) to raise exceptions and crash programs.

link

answered Mar 02 at 08:47

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

I found a workaround for this situation. I run the Date header through the CkoDateTime SetFromRfc822 method. This method returns a BOOL that I use to determine the success of the GetDt call. If I get a "false" on that call, I'll look at various other headers to look for a possible date. If everything else fails, then I use what GetDt gives me. I haven't found a better solution to this problem.

link

answered Mar 02 at 09:53

scottag's gravatar image

scottag
1

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×6

Asked: Mar 01 at 11:46

Seen: 837 times

Last updated: Mar 02 at 09:53

powered by OSQA