• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Question  RSS feed

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to get the SystemDate in this specific format "yyyy-MM-dd".If i do this with format() method in SimpleDateFormat Class the return type is String.If i use the parse method of the same Class then again the actual SystemDate is returned(but not the formatted form)

But, I want the final result to be of Type Date.i.e. I want to get the System Date displayed in the above specified format and the type of the result should be Date.

Pls Help me.

Thanks in Advance,

Vineela
 
Qi Liang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't find SystemDate in J2SE API.
 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SystemDate is neither a Class nor method.

What i mean by system Date is the Current Date.

Vineela
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're thinking of keeping the date object to the format that you've formatted, I'm sorry, its not possible.

To display the date object into your desired format, you've to convert it to a String as you'd done it already.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!