From owner-r-help@stat.math.ethz.ch Wed Feb 23 06:56:07 2000 Return-Path: Received: from stat.math.ethz.ch (majordom@hypatia.ethz.ch [129.132.58.23]) by t2.mscf.uky.edu (8.9.3/8.8.7) with ESMTP id GAA17309 for ; Wed, 23 Feb 2000 06:56:06 -0500 Received: by stat.math.ethz.ch (8.9.1/8.9.1) id MAA12582 for r-help-gang-use; Wed, 23 Feb 2000 12:32:06 +0100 (MET) Received: (from daemon@localhost) by stat.math.ethz.ch (8.9.1/8.9.1) id MAA12576 for ; Wed, 23 Feb 2000 12:32:04 +0100 (MET) Received: from fangorn.ci.tuwien.ac.at(128.131.51.24) via SMTP by hypatia, id smtpdAAAa0034R; Wed Feb 23 12:32:01 2000 Received: from aragorn.ci.tuwien.ac.at (hornik@aragorn.ci.tuwien.ac.at [128.131.51.35]) by fangorn.ci.tuwien.ac.at (8.9.3/8.9.3/Debian/GNU) with ESMTP id MAA09219; Wed, 23 Feb 2000 12:31:20 +0100 Received: (from hornik@localhost) by aragorn.ci.tuwien.ac.at (8.9.3/8.8.5) id MAA31886; Wed, 23 Feb 2000 12:32:17 +0100 From: Kurt Hornik MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14515.50497.296467.512371@aragorn.ci.tuwien.ac.at> Date: Wed, 23 Feb 2000 12:32:17 +0100 (CET) To: "Richard A. Bilonick" Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Problem with Dates In-Reply-To: <38A9C070.A884FC16@nauticom.net> References: <200002151828.NAA24011@jessie.research.bell-labs.com> <38A9C070.A884FC16@nauticom.net> X-Mailer: VM 6.75 under Emacs 19.34.1 Reply-To: Kurt.Hornik@ci.tuwien.ac.at Sender: owner-r-help@stat.math.ethz.ch Precedence: bulk Status: OR >>>>> Richard A Bilonick writes: > Hi, > My dates are printing as 01/01/100 instead of 01/01/2000. I can't find > a way to get mm/dd/yyyy type format. I've tried using > out.format="mm/dd/yyyy" but it writes out the month name (and that is > all). I've installed both chron and date. The version of R is 0.65.1. Chron does not support mm/dd/yyyy etc formats. I am planning to add improved full-year formatting capabilities to chron eventually, but this may take some time. Meanwhile, you can always use out.format = "mon day year" (which will use spaces as separators), or try writing your own format. One quick hack for output formatting: mdY <- function(x) { out <- month.day.year(x) paste(formatC(out$m, width = 2, flag = "0"), formatC(out$d, width = 2, flag = "0"), out$y, sep = "/") } R> x <- chron(15000, out.format = mdY) R> x [1] 01/26/2011 -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._