Skip to content

Instantly share code, notes, and snippets.

View shubham836's full-sized avatar

Shubham shukla shubham836

View GitHub Profile
fun main(args: Array<String>) {
print(getDifferenceInHours("1:00 PM", "2:00 AM", "15", "16"))
}
//14 10
fun getDifferenceInHours(startTime: String, endTime: String, startDate: String, endDate: String): Int {
if (endDate == startDate) {
return inFullDayFormat(endTime).toInt() - inFullDayFormat(startTime).toInt()
} else {
val startTimeWithSeconds= inFullDayFormat(startTime)
package com.example.livedatatest
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.Button
import android.widget.EditText
import androidx.appcompat.app.AppCompatActivity
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope