Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String to timeStamp

Status
Not open for further replies.

timmbo

Programmer
Feb 22, 2001
167
US
Hi All,

Have a jsp variable returning a string "dateFrom" containing "06/10/2004 06:00:01 AM". When I put it to the timeStamp variable, the time is dropped. The date appears in the timeStamp okay. How would I get the time into the timeStamp variable.

Code:
  if(infoReport.getDateFrom() != null) {
    if(!infoReport.getDateFrom().equals("")){
[b]
      custReport.setDateFrom(infoReport.getDateFrom()));
[/b]
    }
  }

getDateFrom - String
custReport.setDateFrom - timeStamp

Any suggestions or comments would be most appreciated.

TIA,

Tim

 
Sorry All. getDateFrom is a Timestamp not a string. So, this leads me to believe my time format is wrong. Does timeStamp have to have a specific format for time?

TIA,

Tim
 
thanks for the reply Sedj. I did figure it out - just didn't dig deep enough into my existing code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top