login about faq

I'm using Chilkat IMAP to search for messages on an IMAP server and I was wondering if I can assume that all IMAP servers search by US formatted date strings?

I had run into an issue where if my iPhone was set to a Japan locale and date format, that the search strings were getting localized to where the month came out with Japanese characters. I forced the date to be of the "en-US" format and everything worked again. I'm just worried about users with IMAP servers abroad that might be expecting a localized date for IMAP commands?

asked Jul 27 '12 at 15:25

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


The answer is found by examining the RFC for the IMAP protocol, which would be RFC 3501 (http://www.ietf.org/rfc/rfc3501.txt)

In Section 6.4.4. (SEARCH Command), here is a snippet:

  
      SENTBEFORE <date>
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is earlier than the specified date.

SENTON <date>
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is within the specified date.

SENTSINCE <date>
         Messages whose [RFC-2822] Date: header (disregarding time and
         timezone) is within or later than the specified date.

SINCE <date>
         Messages whose internal date (disregarding time and timezone)
         is within or later than the specified date.

You would then look in the syntax specification (section 9) to see this:

date            = date-text / DQUOTE date-text DQUOTE

date-day        = 1*2DIGIT
                    ; Day of month

date-day-fixed  = (SP DIGIT) / 2DIGIT
                    ; Fixed-format version of date-day

date-month      = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
                  "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"

date-text       = date-day "-" date-month "-" date-year

date-year       = 4DIGIT

date-time       = DQUOTE date-day-fixed "-" date-month "-" date-year
                  SP time SP zone DQUOTE

The date-month specifies us-EN names for months, so I would expect that all IMAP servers should only work with the en-US date format.

link

answered Jul 27 '12 at 15:30

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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:

×174

Asked: Jul 27 '12 at 15:25

Seen: 6,260 times

Last updated: Jul 27 '12 at 15:30

powered by OSQA