如何在Ireport 4.5中更改日期格式 [英] How to change the date format in Ireport 4.5

查看:188
本文介绍了如何在Ireport 4.5中更改日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经给出了文本字段表达式 new.java.util.Date()和模式 MMMMM dd,yyyy 如上所述的格式。

I have given text field expression new.java.util.Date() and pattern MMMMM dd, yyyy as the mentioned format.

日期必须显示如下: 2012年1月13日但它显示的是其他格式: Fri Jan 13 08:30:12 IST 2012

The date must display like: jan 13, 2012 but it's displaying in some other format: Fri Jan 13 08:30:12 IST 2012.

那么如何以上述格式打印日期。预览中的一件事日期显示正确如上所述,但在我的应用程序中它显示 Fri Jan 13 08:30:12 IST 2012 格式。有没有办法让它正常工作?

So how to print the date in the mentioned format. And one thing in preview the date displays correctly as mentioned but inside my application it displays Fri Jan 13 08:30:12 IST 2012 format. Is there any way to make it to work properly?

推荐答案

new SimpleDateFormat("MMM dd, yyyy ").format(new Date()) 

将上面一行放在文本字段中你会得到你的日期格式

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

这篇关于如何在Ireport 4.5中更改日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆