Convert Java date to String

One Star

Convert Java date to String

Is there an easy way to convert a Java date in milliseconds to a string date?
Community Manager

Re: Convert Java date to String

Hello
Yes, it is easy to convert a date in millisenconds to a string.
for example, on tJava:
java.util.Date date=new java.util.Date(long date);
String s=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", date);
System.out.println(s);

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Convert Java date to String

Thanks!!
One Star

Re: Convert Java date to String

Hi,
if you do not need any special format, this would be much faster:
yourDate.toString()

Bye
Volker