From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Edward O'Connor" Newsgroups: gmane.emacs.devel,gmane.org.w3c.miscellaneous Subject: Format modifier suggestion for format-time-string Date: Fri, 19 Nov 2010 11:23:09 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1290194627 12946 80.91.229.12 (19 Nov 2010 19:23:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 19 Nov 2010 19:23:47 +0000 (UTC) Cc: www-archive@w3.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 19 20:23:44 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PJWYh-00045k-NQ for ged-emacs-devel@m.gmane.org; Fri, 19 Nov 2010 20:23:43 +0100 Original-Received: from localhost ([127.0.0.1]:34946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJWYg-0000s1-Sc for ged-emacs-devel@m.gmane.org; Fri, 19 Nov 2010 14:23:42 -0500 Original-Received: from [140.186.70.92] (port=59262 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJWYX-0000qI-T5 for emacs-devel@gnu.org; Fri, 19 Nov 2010 14:23:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJWYV-000801-Np for emacs-devel@gnu.org; Fri, 19 Nov 2010 14:23:33 -0500 Original-Received: from mail-qy0-f169.google.com ([209.85.216.169]:48420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJWYV-0007zZ-Lc for emacs-devel@gnu.org; Fri, 19 Nov 2010 14:23:31 -0500 Original-Received: by qyk2 with SMTP id 2so8872qyk.0 for ; Fri, 19 Nov 2010 11:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:cc:content-type; bh=lQkmW7VpZzyNa/j7aCMCAqndL/nbGF/bqy9TPysmUDU=; b=eLeizLVik9kUyQMrazJr0Hgy3Nd5y5rQFMUAKhHKeVsy5KCECQhC22L6qdp6vUfozx V7NKJlP8Fq70zZFbEN6dI8HSeyQX0EU0bhgAN6BUtzsmHKVmyNPh0hvuymn6Pr7DgxC4 ebjIyVoanVG9CwDNaZI5y6EABOu2oIsuj6kKM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=WLwY8I4sKxZ46ZPl43PHlMyMofVABCbfclBOLy/hJHHduv9Tbac8PDTmmRyk/l2gAV lMaWT06a+S0lTK+2fqhIboYTtK+EYOS7t82GAoWbBV1sJv62j+KrOJMK22FQFH1l7fTQ eDWcwNFL/ILA7K/gkJ/Jv+0rABv9pRskLV8zw= Original-Received: by 10.229.86.149 with SMTP id s21mr2083398qcl.234.1290194610733; Fri, 19 Nov 2010 11:23:30 -0800 (PST) Original-Received: by 10.229.224.206 with HTTP; Fri, 19 Nov 2010 11:23:09 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132877 gmane.org.w3c.miscellaneous:3977 Archived-At: Hi. When generating data formats that rely on RFC 3339 date and time formats (Atom, say) in elisp, I've often found myself having to do something like this: (defun rfc3339-datetime (&optional time) (let ((stamp (format-time-string "%Y-%m-%dT%H:%M:%S%z" time))) (format "%s:%s" (substring stamp 0 -2) (substring stamp -2)))) In RFC 3339, the colon separating hours and minutes within a time zone offset is mandatory, but `format-time-string' doesn't have the ability to generate time zone offsets with a colon in them. I'd like to suggest the addition of a : modifier, such that (format-time-string "%:z") would generate an RFC 3339-compatible time zone offset. What do you think? Thanks for the consideration, Ted