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

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -