From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger Newsgroups: gmane.emacs.help Subject: Re: Emacs Calc: converting FROM Unix Time, unrecognized time zone Date: Fri, 04 May 2007 10:31:32 -0500 Message-ID: <87vef8zju3.fsf@gmail.com> References: <1178178488.621197.214660@c35g2000hsg.googlegroups.com> <87k5vpizqu.fsf@gmail.com> <1178289021.372483.28440@e65g2000hsc.googlegroups.com> Reply-To: jay.p.belanger@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1178292854 21508 80.91.229.12 (4 May 2007 15:34:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 May 2007 15:34:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 04 17:34:13 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HjznQ-0001ud-Qi for geh-help-gnu-emacs@m.gmane.org; Fri, 04 May 2007 17:34:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hjzu4-0002iR-Bk for geh-help-gnu-emacs@m.gmane.org; Fri, 04 May 2007 11:41:04 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!feed.news.qwest.net!mpls-nntp-01.inet.qwest.net!newshub.more.net!news.more.net!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:1Fifw+k/w8gMqHqMIz575Ymhveo= Original-Lines: 39 Original-NNTP-Posting-Host: 150.243.64.25 Original-X-Trace: news.more.net 1178292693 150.243.64.25 (Fri, 04 May 2007 10:31:33 CDT) Original-NNTP-Posting-Date: Fri, 04 May 2007 10:31:33 CDT Original-Xref: shelby.stanford.edu gnu.emacs.help:148069 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43668 Archived-At: Alan writes: ... > I would like to be able to extract only decimal hours from the date > string "2007-05-05 14:30". Is this possible? I can easily do it by > grabbing the minutes form and dividing by 60 in calc. Of course, a > more direct approach would be helpful. 't P' (`calc-date-part') will get it for you. Enter the date with algebraic notation: <2007-05-05 14:30> then, to get the hours, either `C-u 4 t P' or `t P', and then type `4' at the prompt (which will also tell you which number to type to get the date parts: `1' for year,..., `4' for hours). > I am now struggling with how to set the time zone variable. I guess > I can use Sydney time, or GMT-10? A list of values that Calc recognizes is in the "Time Zones" section of the Calc manual. Perhaps the TimeZone variable should be made customizable; for now, `s T' will take you to a buffer to set the variable, and `s p TimeZone' will store the value permanently in your calc initialization file. > The calc manual says: > "f your system does not have a suitable `date' command, you may > wish to put a `(setq var-TimeZone ...)' in your Emacs > initialization file to set the time" > > This variable is undocumented in emacs 23.0.0 (Gentoo GNU/Linux). It's not documented as an Emacs lisp variable (although I guess it should be), but it is documented as a Calc variable. It is in the variable index of the Calc manual under "TimeZone". As a Calc variable, it is "TimeZone", but to deal with it directly from elisp, you need to use `var-TimeZone'. (In general, the Calc variable `foo' corresponds to the lisp variable `var-foo'.) Jay