Jump to content
We've recently updated our Privacy Statement, available here ×

Date to string


2004 IR Help

Recommended Posts

By: Adrian din - nida0

Date to string

2004-02-10 05:03

how can I convert a data to a string ? (I want to use only a Text field for displaying both text and data values)

 

Thank You,

Adrian Din

 

 

 

 

By: Giulio Toffoli - gt78

RE: Date to string

2004-02-10 08:16

The simplest way is:

 

""+ your_date

 

This cast the Date in a String

 

Giulio

 

 

 

 

By: Adrian din - nida0

RE: Date to string

2004-02-11 05:53

thank you - so this is the problem:

when I used "The date" + date it was ok

whent using date (string text) - error ....

 

 

 

 

 

By: Philippe Damerval - damerval

RE: Date to string

2004-02-11 11:56

One way with a good control over the way the date is formatted is to use the SimpleDateFormat class.

It would look something like this:

 

new SimpleDateFormat('dateformat').format(mydate)

 

You can lookup the acceptable values for 'dateformat' in the javadoc under the class, SimpleDateFormat. Here's a link:

http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html

 

 

 

 

By: Adrian din - nida0

RE: Date to string

2004-02-12 00:37

yes you are right - this is the finest way - I am using SimpleDateFormat also because in Ireports it is a bug (Linux Ireports.sh) and the pattern for data type field is not always saved ...

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...