Path: news.mathworks.com!not-for-mail
From: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: converting times
Date: Fri, 27 Jul 2007 15:24:28 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 7
Message-ID: <f8d2nc$a3a$1@fred.mathworks.com>
Reply-To: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
NNTP-Posting-Host: webapp-01-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185549868 10346 172.30.248.36 (27 Jul 2007 15:24:28 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 27 Jul 2007 15:24:28 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034320
Xref: news.mathworks.com comp.soft-sys.matlab:421415



I have an excel file with a column of times in the format H:MM PM (i.e. 1:36 PM, 12:01 AM, etc.).  I would like to be able to import this column into matlab and convert the times to a 24-hr decimal equivalent.  For example, 

1:36 PM = 13.6000
12:00 AM = 24.0000
12:01 AM = 00.0167

I think I can do it with a combination of 'datenum' and 'datestr', but I can't quite figure it out.  Any suggestions?  Thanks.