aspose file tools*
The moose likes JSP and the fly likes how to convert string to int in jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to convert string to int in jsp?" Watch "how to convert string to int in jsp?" New topic
Author

how to convert string to int in jsp?

amanda wu
Greenhorn

Joined: Mar 16, 2003
Posts: 25
or how to convert string to calender object ?
i want to convert dates (yy/mm/dd/hr/min/sec) to unix time
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
use the standart methods from api ... like
Integer.parseInt(String) and so on...


Asher Tarnopolski
SCJP,SCWCD
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
If you have a date string in a nice consistent format, you can use the java.text.SimpleDateFormat class to parse it into a Date object. You can use the Date object method getTime() to get the UNIX milliseconds.
SimpleDateFormat is not all that simple but it is very general. For example..

can parse a date string like this:
"11/25/02 3:47:17 PM CST"
Bill


Java Resources at www.wbrogden.com
amanda wu
Greenhorn

Joined: Mar 16, 2003
Posts: 25
many thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to convert string to int in jsp?
 
Similar Threads
how to convert Byte to the String
How to compare String and int?
How to convert String to EBCIDC format
How to convert String to org.w3c.dom.Document
String array to arraylist