java - simpleDateFormatter not working on websphere -
i working on java 1.7 on ubuntu. code , functionality working fine. when deployed on websphere java.text.simpledateformatter
not working... , displaying parse error.my websphere enviornment has linux , java 1.4.2. if knows issue, please me.
here code
public static string formatdate(string commingdate){ string formateddate = "00-00-00"; try { simpledateformat sdf = new simpledateformat("dd-mm-yyyy"); date date = sdf.parse(commingdate); formateddate = sdf.format(date); } catch (parseexception e) { log.error(e); } return formateddate; }
the simpledataformat(string)
constructor uses default system locale. it's possible websphere server has different default locale causes different behavior. try specify locale explicitly:
simpledateformat sdf = new simpledateformat("dd-mm-yyyy", locale.english);
see this answer similar problem.
Comments
Post a Comment