From: Kelly <kakearney@nospamgmail.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: datestr problems
Message-ID: <ef5c642.-1@webcrossing.raydaftYaTP>
Date: Tue, 3 Jul 2007 14:34:09 -0400
Lines: 35
NNTP-Posting-Host: 128.112.176.103
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:417059



I'm seeing some odd behavior with the datestr function. There seems
to be an upper limit on the value of the month number in the input
date vector in order to return the proper string. For example,

datestr([1950 522 15 12 0 0])

ans =

15-Jun-1993 12:00:00

This is the answer that I was expecting. However,

datestr([1950 523 15 12 0 0])

ans =

03-May-0005
06-Jun-0001
15-Jan-0000
12-Jan-0000
00-Jan-0000
00-Jan-0000

The problem seems to occur somewhere in the mex file that does the
major calculations (datevecmx); for some reason it is returning 6 x 1
vectors for the year, month, etc, instead of the scalar values it
should be getting.

Does anyone else see this behavior? Also, does anyone know of a
workaround? I have a lot of data that is given in "months since
1950", and I am looking for an easy way to convert this to
dd-mmm-yyyy strings.

Thanks,
Kelly