开发者

Android Date Format Help

开发者 https://www.devze.com 2023-03-01 03:35 出处:网络
Hi guys i am using a simple code to get current date and change its form开发者_运维百科at but i am unable to do so every time i use the SimpleDateFormat class the application crashes with out being ex

Hi guys i am using a simple code to get current date and change its form开发者_运维百科at but i am unable to do so every time i use the SimpleDateFormat class the application crashes with out being executed.

I am pasting my code here:

    Date d=new Date();
  SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/YYYY",Locale.ENGLISH);
  String newd= formatter.format(d);

can some body point out my mistake that i am making here??

Thank you in advance for your help!!


YYYY should be yyyy

  • SimpleDateFormat
0

精彩评论

暂无评论...
验证码 换一张
取 消