% tested with matlab R2010a and octave 3.6.1 with patched datevec
% the date vectors on the right of the equal sign corresponds to results from matlab.

% dates recognized without FildSpecIn

assert(all(datevec('01-Mar-2000 15:45:17')   == [    2000      3      1     15     45     17]))
assert(all(datevec('01-Mar-2000')            == [    2000      3      1      0      0      0]))
assert(all(datevec('03/01/00')               == [    2000      3      1      0      0      0]))
assert(all(datevec('03/01')                  == [    2012      3      1      0      0      0]))
assert(all(datevec('15:45:17')               == [    2012      1      1     15     45     17]))
assert(all(datevec('3:45:17 PM')             == [    2012      1      1     15     45     17]))
assert(all(datevec('15:45')                  == [    2012      1      1     15     45      0]))
assert(all(datevec('3:45 PM')                == [    2012      1      1     15     45      0]))
assert(all(datevec('03/01/2000')             == [    2000      3      1      0      0      0]))

% dates with FildSpecIn

assert(all(datevec('01-Mar-2000 15:45:17',0)    == [    2000      3      1     15     45     17]))
assert(all(datevec('01-Mar-2000',1)             == [    2000      3      1      0      0      0]))
assert(all(datevec('03/01/00',2)                == [  100   3   1   0   0   0]			 ))
assert(all(datevec('03/01',6)                   == [    2012      3      1      0      0      0]))
assert(all(datevec('15:45:17',13)               == [    2012      1      1     15     45     17]))
assert(all(datevec('3:45:17 PM',14)             == [    2012      1      1     15     45     17]))
assert(all(datevec('15:45',15)                  == [    2012      1      1     15     45      0]))
assert(all(datevec('3:45 PM',16)                == [    2012      1      1     15     45      0]))
assert(all(datevec('01/03',19)                  == [    2012      1      3      0      0      0]))
assert(all(datevec('01/03/00',20)               == [  100   1   3   0   0   0]			 ))
assert(all(datevec('Mar.01,2000 15:45:17',21)   == [    2000      3      1     15     45     17]))
assert(all(datevec('Mar.01,2000',22)            == [    2000      3      1      0      0      0]))
assert(all(datevec('03/01/2000',23)             == [    2000      3      1      0      0      0]))
assert(all(datevec('2000/03/01',26)             == [    2000      3      1      0      0      0]))
assert(all(datevec('2000-03-01',29)             == [    2000      3      1      0      0      0]))
assert(all(datevec('2000-03-01 15:45:17',31)    == [    2000      3      1     15     45     17]))


% Strange/bogous behavior in matlab

datevec('Mar00',12) % mmmyy
datevec('01/03/2000',24) %dd/mm/yyyy
datevec('00/03/01',25) %yy/mm/dd
datevec('Mar2000',28) %mmmyyyy


% dates not recognized (only for datestr)

%datevec('Mar',3)
%datevec('M',4)
%datevec('03',5)
%datevec('01',7)
%datevec('Wed',8)
%datevec('W',9)
%datevec('2000',10)
%datevec('00',11)
%datevec('Q1-01',17)
%datevec('Q1',18)
%datevec('Q1-2001',27)
%datevec('20000301T154517',30)
