I have the following code:
var format_time="28-06-12 9:30:50";
var my_time_array=format_time.split(":");
alert(my_time_array[0]); // alerts 28-06-12 9
alert(my_time_array[1]); // alerts 30
alert(my_time_array[2]); // alerts 50
The first alert incorrectly displays "28-06-12 9", when I only want it to display "9". Additionally, if format_time="28-06-12 10:30:50", then I would want it to display "10".
I can't seem to work it out. Any ideas?