view m-toolbox/classes/@time/matfrmt2javafrmt.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

function frmt = matfrmt2javafrmt(frmt)
% convert MATLAB time formatting specification string into a Java one

  % translate numeric MATLAB time formats into string ones
  if isnumeric(frmt)
    frmt = time.getdateform(frmt);
  end
  
  for kk = 1:length(frmt)
    switch frmt(kk)
      case 'm'
        frmt(kk) = 'M';
      case 'M'
        frmt(kk) = 'm';
      case 'S'
        frmt(kk) = 's';
      case 'F'
        frmt(kk) = 'S';
      case 'P'
        if frmt(kk+1) == 'M'
          frmt(kk)   = 'a';
          frmt(kk+1) = 'a';
        end
    end
  end

  % properly quote the T into ISO8896 date formats
  frmt = strrep(frmt, 'T', '''T''');
end