How to change the date format in Ireport 4.5

两盒软妹~` 提交于 2019-12-06 01:26:34
new SimpleDateFormat("MMM dd, yyyy ").format(new Date()) 

Put the above line in text field so you will get your Date format

harish525

Use this below method..hope it will help to you

public static String getDateTimeForUgcServer(String date)
    {

        SimpleDateFormat intputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date dt = new Date();
        try
        {
            dt = intputFormat.parse(date);
        }
        catch (ParseException e)
        {
            e.printStackTrace();
        }

        SimpleDateFormat outputFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        String str = outputFormat.format(dt);
        return str;
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!