Hi all, SubmittedDate in my database is like this and I defined it as a string "Wed Dec 12 12:08:56 PST 2001" but I don't know why I couldn't get output I mean when I wanted to print it nothing pass but the otherside I don't have any problem to pass and print FixedDate which is like this "2001-12-05". Please help. Thanks, Elaheh
Thanks,
Elahe
Andy Jackson
Greenhorn
Joined: Aug 22, 2001
Posts: 3
posted
0
How are you printing? System.out.println or something else? Should use Calendar for dates.
Shubhrajit Chatterjee
Ranch Hand
Joined: Aug 23, 2001
Posts: 356
posted
0
Originally posted by elahe shafie: Hi all, SubmittedDate in my database is like this and I defined it as a string "Wed Dec 12 12:08:56 PST 2001" but I don't know why I couldn't get output I mean when I wanted to print it nothing pass but the otherside I don't have any problem to pass and print FixedDate which is like this "2001-12-05". Please help. Thanks, Elaheh
You should have stated your problem more clearly. Anyway , submitted date, as you are showing is a perfect java String so you should have no problem in printing it. Maybe a code snippet will help people to solve your problem
------------------ Shubhrajit
Shubhrajit
Dave Turner
Ranch Hand
Joined: Mar 13, 2001
Posts: 60
posted
0
It sounds like you are having trouble extracting the date from your database, this could be to do with the way you are trying to retrieve it. If you are storing it as a String, you will not be able to retrieve it as a Date. You must store the date as a Date object in your database in order to do this. Equally if you have stored the date as a String then you should have no trouble extracting it as a String. Without seeing your code it is difficult to say anymore than this Dave
Elahe Shafie
Ranch Hand
Joined: Dec 12, 2001
Posts: 291
posted
0
Many thanks to all for your support Elahe
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.