Results 1 to 3 of 3
Thread: need to adjust time
- 07-24-2011, 08:01 PM #1Member
- Join Date
- Jul 2011
- Rep Power
need to adjust time
What is a good way to turn standard time into an integer? In other words i need
String 4:30 to become int 430. The parse String method just turns the : into a , and I can't find a method that will just remove the : from a String. Suggestions?
Last edited by MetalR0; 07-24-2011 at 08:22 PM.
- 07-24-2011, 08:29 PM #2
Look in the API doc for the String class's methods. There are some that will do what you want.
You could use one method to find the location of the ":" and another to get the part before and the part after where the ":" was located.
There is another that could replace the ":" with an empty string.
Also, if you want to convert Date into a String and visa-versa, please have a look at the SimpleDateFormat class.
- By lipkee85 in forum Java AppletsReplies: 1Last Post: 08-22-2010, 04:29 AM
- By Trdmrk in forum AWT / SwingReplies: 1Last Post: 07-19-2010, 01:31 AM
- By mlibot in forum New To JavaReplies: 14Last Post: 09-18-2009, 05:48 AM
- By carag in forum New To JavaReplies: 2Last Post: 07-29-2009, 01:23 PM
- By louiebagz in forum AWT / SwingReplies: 2Last Post: 07-01-2007, 08:37 AM