This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date

 
Elahe Shafie
Ranch Hand
Posts: 291
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Andy Jackson
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you printing? System.out.println or something else?
Should use Calendar for dates.
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Turner
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 291
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks to all for your support
Elahe
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic