From: Keith G. <kwg...@gm...> - 2005-06-09 23:14:53
|
Is this how I submit a patch to octave-forge? main/time/datestr.m: Format 'dd' now pads with leading zero if day is less than 10. Current behaviour datestr(now,"dd") ans =3D 9 Patched behaviour (compatible and more consistent with dd in other contexts such as mm/dd/yyyy) datestr(now,"dd") ans =3D 09 --- datestr.m 2005-06-09 09:00:56.455208088 -0700 +++ datestr2.m 2005-06-09 09:01:58.381793816 -0700 @@ -27,7 +27,7 @@ ## @item 4 @tab m @tab S ## @item 5 @tab mm @tab 9 ## @item 6 @tab mm/dd @tab 09/07 -## @item 7 @tab dd @tab 7 +## @item 7 @tab dd @tab 07 ## @item 8 @tab ddd @tab Thu ## @item 9 @tab d @tab T ## @item 10 @tab yyyy @tab 2000 @@ -128,7 +128,7 @@ case { 6, 'mm/dd' } str =3D sprintf("%02d/%02d",M,D); case { 7, 'dd' } - str =3D sprintf("%d",D); + str =3D sprintf("%02d",D); case { 8, 'ddd' } [d,str] =3D weekday(datenum(Y,M,D)); case { 9, 'd' } |