cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get Date in this format - 04/Feb/2008

sankar_narayana
Active Participant
0 Kudos

I need to get the date in this format - 04.Feb/2008. How can i get it using Java coding..

java.sql.date

Please reply to this..

Accepted Solutions (0)

Answers (2)

Answers (2)

sankar_narayana
Active Participant
0 Kudos

My problem is solved.

Former Member
0 Kudos

Hi,

Date date = new Date(Calendar.getInstance().getTimeInMillis()); // your SQL Date

Format formatter = new SimpleDateFormat("dd/MMM/yyyy");

String s = formatter.format(date);

Regards

Ayyapparaj

sankar_narayana
Active Participant
0 Kudos

I have imported

import java.sql.*;

import java.util.Calendar;

import java.text.DateFormat;

import java.text.Format;

But still it is saying SimpleDateFormat cannot be resolved.

Helpful answer will be rewarded..

Edited by: Sankar Narayana on Feb 4, 2008 1:45 PM

Former Member
0 Kudos

Hi,

Use

import java.text.SimpleDateFormat;

Regards

Ayyapparaj

sankar_narayana
Active Participant
0 Kudos

Hi Ayyapparaj,

Hey i got the answer, Thanks for your timely reply but still when i change my system date it is taking my system date.

What ever format i need it i got it but...

04/Feb/2008

Can i get Server Date here

Former Member
0 Kudos

Hi,

Are you running this code in a java file which is running on your local system???

Is this is webapp/webdynpro???

If this is a web app/webdynpro and if its deployed on the server, it should take the time of the system(server) where the app is deployed.

Regards

Ayyapparaj

sankar_narayana
Active Participant
0 Kudos

Hi,

I run this code in my local machine. I also got the same thought.Ok anyway thanks a lot for your reply.

We are using PDK Developement in our Project.I will put this code in the project and run the code.