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  = 0; int     minutes  = 0; int     hours    = 0; boolean detected = false;

for ( int i = 0; i < 3; i++ ) {           time[i] = 0; }

if ( millis > 3600000 ) {           hours = millis;

while ( detected == false ) {               if ( ( hours / 3600000 ) < 1 ) {                   detected = true; }               else {                   hours = (int) ( hours / 3600000 ); }           }            detected = false; }       else {           //time[0] = 0; }

if ( millis > 60000 ) {           minutes = (int) ( millis - ( hours * 60 ) );

while ( detected == false ) {               if ( ( minutes / 60000 ) < 1 ) {                   detected = true; }               else {                   minutes = (int) ( minutes / 60000 ); }           }            detected = false; }       else {           time[2] = (int) ( millis / 1000 ); }

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

return time; } }