cancel
Showing results for 
Search instead for 
Did you mean: 

how to display current date n time in a given format

Former Member
0 Kudos

Hi Forum

I want to print the current date along with time in the format dd/mm/yyyy hh:mm:ss

Thanks & Regards

Jaspreet Kaur Grewal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

the format is cumming correct but the time it shud give 3:13 which is my system time but its giving 9:32

Former Member
0 Kudos

Hi,

Where's your WAS running? Is it on your local system?

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit

No WAS is at the client location not on my system.

Regards,

Jaspreet Kaur Grewal

Former Member
0 Kudos

Hi,


   Date currDate = new Date(Calendar.getInstance().getTimeInMillis()); 
   Format formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); 
   String formattedDate = formatter.format(currDate); 

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit

This is what I was looking for. But the time is not cummin as system time. Thanks

Regards,

Jaspreet Kaur Grewal

Edited by: Jaspreet Kaur Grewal on Feb 7, 2008 10:45 AM