I have two ints 1530 and 830 which is supposed to represent 15:30 and 8:30 in time. What is the best way to convert this number into milliseconds? I was thinking of converting them into strings and sub strings but this seems like a very inefficient approach.
int mins = yourint % 100;
int hours = yourint / 100;  
long timeInMillis = mins * 60000L + hours * 360000L; 
                        int twentyFourHourTimeToMilliseconds(int time) {
    int hours = time / 100;
    int minutes = time % 100;
    return ((hours * 60) + minutes) * 60000;
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With