From f96026b6f9cb2862c5bf4c182dfce0ce0922856e Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 16 May 2000 03:58:40 +0000 Subject: [PATCH] Change INTERNALDATE FETCH response to return the time as universal time. --- v7/src/imail/imap-response.scm | 15 +++++++++++++-- v7/src/imail/imap-response.txt | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/v7/src/imail/imap-response.scm b/v7/src/imail/imap-response.scm index c8bdf31bf..75a3f242f 100644 --- a/v7/src/imail/imap-response.scm +++ b/v7/src/imail/imap-response.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imap-response.scm,v 1.14 2000/05/16 03:33:49 cph Exp $ +;;; $Id: imap-response.scm,v 1.15 2000/05/16 03:58:31 cph Exp $ ;;; ;;; Copyright (c) 2000 Massachusetts Institute of Technology ;;; @@ -164,7 +164,7 @@ (read-flags-response port)) ((INTERNALDATE) (discard-known-char #\space port) - (read-quoted port)) + (parse-date-time (read-quoted port))) ((RFC822 RFC822.HEADER RFC822.TEXT) (discard-known-char #\space port) (read-nstring port)) @@ -201,6 +201,17 @@ (let ((pv (parse-string imap:parse:section string))) (and pv (parser-token pv 'SECTION)))) + +(define (parse-date-time string) + (decoded-time->universal-time + (make-decoded-time + (string->number (substring string 18 20)) + (string->number (substring string 15 17)) + (string->number (substring string 12 14)) + (string->number (string-trim-left (substring string 0 2))) + (string->month (substring string 3 6)) + (string->number (substring string 7 11)) + (string->time-zone (string-tail string 21))))) (define (read-generic port) (let ((char (peek-char-no-eof port))) diff --git a/v7/src/imail/imap-response.txt b/v7/src/imail/imap-response.txt index 78c093c33..914647cd6 100644 --- a/v7/src/imail/imap-response.txt +++ b/v7/src/imail/imap-response.txt @@ -1,4 +1,4 @@ -$Id: imap-response.txt,v 1.2 2000/05/08 13:56:40 cph Exp $ +$Id: imap-response.txt,v 1.3 2000/05/16 03:58:40 cph Exp $ Notes on IMAP server responses @@ -254,7 +254,7 @@ Notes on IMAP server responses = (ENVELOPE ) | (FLAGS (*)) - | (INTERNALDATE ) + | (INTERNALDATE ) | (RFC822 ) | (RFC822.HEADER ) | (RFC822.TEXT ) -- 2.25.1