| Author |
how to get the date from the string representation of date
|
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
hello everyone,
i have a datecombobox named endDateCombo.....i have set the value of it by providing
now i am extracting the value from endDateCombo as:
Once i have done this i need to know a way so that am able to extract the Date and time from the above string specified so that i can typecast it to Timestamp and perform comparisons.
please help
thanks.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 915
|
|
I think you need to use method :
|
My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
|
 |
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
thanks for the reply...
you mean that i need to write the following statements to get the date and time from the string representation:
and once i get the date representation i'll write the following statement to get the timestamp:
please reply
thanks
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1196
|
|
|
I think yes.
|
Swastik
|
 |
subhash kumar
Ranch Hand
Joined: Jul 14, 2010
Posts: 63
|
|
If you want java.util.Date here is example:
and if the java.sql.Date
|
Subhash Kumar
Attitude is everything
|
 |
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
|
thanks for the replies...am trying the ways suggested by you all to get my problem solved....
|
 |
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
@ swastik dey:
i tried the way you suggested...
but am getting errors:
could anyone explain where exactly am going wrong with the parsing???
|
 |
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
@subhash kumar:
thanks for your reply..
the imoprts in my application are:
and its giving the error which i have already posted in the previous post.
thanks
|
 |
Somnath Mallick
Ranch Hand
Joined: Mar 04, 2009
Posts: 471
|
|
Neha:
Read this
http://www.roseindia.net/java/java-conversion/StringToDate.shtml
Hope it would help!
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
Don't put such long lines inside code tags.
|
 |
neha priya
Ranch Hand
Joined: Jul 03, 2010
Posts: 62
|
|
|
@Campbell Ritchie:Sorry..will take care from next time
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
Apologies accepted. It's just that such long lines expand the window beyond the width of the screen and are difficult to read.
|
 |
 |
|
|
subject: how to get the date from the string representation of date
|
|
|