User:RavynousHunter/Notepad

Notepad for me to test shit out and help dudes with stuff...

Millisecond Converter for Aiden:

import javax.swing.JOptionPane;

public class test {   public static void main( String args[] ) {       String secString = JOptionPane.showInputDialog( null, "Enter milliseconds to get the equivalent hours minutes and seconds:", "Exam Input", JOptionPane.QUESTION_MESSAGE ); int   sec = Integer.parseInt( secString ); int[] a   = ConvertMillis( sec );

System.out.println( Integer.toString( a[0] ) + ":" + Integer.toString( a[1] ) + ":" + Integer.toString( a[2] ) ); }

public static int[] ConvertMillis( int millis ) {       int[] time     = new int[3]; int  seconds  = millis; int  minutes  = 0; int  hours    = 0; bool detected = false;

// Detect the # of seconds given // in the "millis" argument

while ( detected == false ) {           if ( ( seconds / 1000 ) < 1 ) {               detected = true; }           else {               seconds = (int) ( seconds / 1000 ); }       }

// If no minutes are detected, // exit the function and return // only seconds. if ( seconds < 60 ) {           time[0] = 0; time[1] = 0; time[2] = seconds;

return time; }       else {           detected = false; minutes = seconds; }

// Detect the # of minutes given // in the "millis" argument, by       // way of the "seconds" variable. while ( detected == false ) {           if ( ( minutes / 60 ) < 1 ) {               detected = true; }           else {               minutes = (int) ( seconds / 60 ); }       }

// If no hours are detected, // return only minutes and // seconds. if ( minutes < 60 ) {           time[0] = 0; time[1] = minutes; time[2] = seconds;

return time; }       else {           detected = false; hours   = minutes; }

// Detecting # of hours... while ( detected == false ) {           if ( ( hours / 60 ) < 1 ) {               detected = true; }           else {               hours = (int) ( hours / 60 ); }       }

time[0] = hours; time[1] = minutes; time[2] = seconds;

return time; } }