Results 1 to 3 of 3
Thread: need to adjust time
- 07-24-2011, 07:01 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 23
- Rep Power
- 0
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 07:22 PM.
- 07-24-2011, 07: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.
Similar Threads
-
Adjust scrolling in canvas
By lipkee85 in forum Java AppletsReplies: 1Last Post: 08-22-2010, 03:29 AM -
Using input from JTextField to adjust column size of another
By Trdmrk in forum AWT / SwingReplies: 1Last Post: 07-19-2010, 12:31 AM -
Why Buttons and label also adjust when i adjust my textbox?
By mlibot in forum New To JavaReplies: 14Last Post: 09-18-2009, 04:48 AM -
need to adjust a code I have to work with hidden fields
By carag in forum New To JavaReplies: 2Last Post: 07-29-2009, 12:23 PM -
How To:Use a JSlider to adjust Text size in a JPanel
By louiebagz in forum AWT / SwingReplies: 2Last Post: 07-01-2007, 07:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks