ANDROIDSTUDYCHANNEL Telegram 3319
fun covertTimeToText(dataDate: String): String? {
var convertTime: String? = null
try {
val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
val pasTime: Date = dateFormat.parse(dataDate)
val nowTime = Date()
val dateDiff = floor((nowTime.time.toDouble() - pasTime.time.toDouble()) / 1000).toInt()
when {
dateDiff < 60 -> {
convertTime = "لحظاتی پیش"
}
dateDiff < 150 -> {
convertTime = "دقایقی پیش"
}
dateDiff < 300 -> {
convertTime = "۵ دقیقه پیش"
}
dateDiff < 600 -> {
convertTime = "۱۰ دقیقه پیش"
}
dateDiff < 900 -> {
convertTime = "یک ربع پیش"
}
dateDiff < 1800 -> {
convertTime = "نیم ساعت پیش"
}
dateDiff in 1800..3599 -> {
convertTime = "۴۵ دقیقه پیش"
}
dateDiff in 3600..86400 -> {
val interval = (dateDiff / 3600)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " ساعت پیش "
}
dateDiff in 86400..2591999 -> {
val interval = (dateDiff / 86400)
when (interval) {
1 -> {
convertTime = "دیروز"
}
in 2..6 -> {
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " روز پیش "
}
7 -> {
convertTime = "یک هفته پیش"
}14 -> {
convertTime = "دو هفته پیش"
}21 -> {
convertTime = "سه هفته پیش"
}28 -> {
convertTime = "چهار هفته پیش"
}
else -> {
convertTime =
Farsi_Number_Change.Changefarsi(interval.toString()) + " روز پیش "
}
}

}
dateDiff in 2592000..31535999 -> {
val interval = (dateDiff / 2592000)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " ماه پیش "
}

dateDiff in 31536000..915360000 -> {
val interval = (dateDiff / 31536000)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " سال پیش "
}

}

} catch (e: Exception) {

}
return convertTime
}



tgoop.com/AndroidStudyChannel/3319
Create:
Last Update:

fun covertTimeToText(dataDate: String): String? {
var convertTime: String? = null
try {
val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
val pasTime: Date = dateFormat.parse(dataDate)
val nowTime = Date()
val dateDiff = floor((nowTime.time.toDouble() - pasTime.time.toDouble()) / 1000).toInt()
when {
dateDiff < 60 -> {
convertTime = "لحظاتی پیش"
}
dateDiff < 150 -> {
convertTime = "دقایقی پیش"
}
dateDiff < 300 -> {
convertTime = "۵ دقیقه پیش"
}
dateDiff < 600 -> {
convertTime = "۱۰ دقیقه پیش"
}
dateDiff < 900 -> {
convertTime = "یک ربع پیش"
}
dateDiff < 1800 -> {
convertTime = "نیم ساعت پیش"
}
dateDiff in 1800..3599 -> {
convertTime = "۴۵ دقیقه پیش"
}
dateDiff in 3600..86400 -> {
val interval = (dateDiff / 3600)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " ساعت پیش "
}
dateDiff in 86400..2591999 -> {
val interval = (dateDiff / 86400)
when (interval) {
1 -> {
convertTime = "دیروز"
}
in 2..6 -> {
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " روز پیش "
}
7 -> {
convertTime = "یک هفته پیش"
}14 -> {
convertTime = "دو هفته پیش"
}21 -> {
convertTime = "سه هفته پیش"
}28 -> {
convertTime = "چهار هفته پیش"
}
else -> {
convertTime =
Farsi_Number_Change.Changefarsi(interval.toString()) + " روز پیش "
}
}

}
dateDiff in 2592000..31535999 -> {
val interval = (dateDiff / 2592000)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " ماه پیش "
}

dateDiff in 31536000..915360000 -> {
val interval = (dateDiff / 31536000)
convertTime = Farsi_Number_Change.Changefarsi(interval.toString()) + " سال پیش "
}

}

} catch (e: Exception) {

}
return convertTime
}

BY 🔴 ANDROID PROGRAMMING CHANNEL


Share with your friend now:
tgoop.com/AndroidStudyChannel/3319

View MORE
Open in Telegram


Telegram News

Date: |

The group also hosted discussions on committing arson, Judge Hui said, including setting roadblocks on fire, hurling petrol bombs at police stations and teaching people to make such weapons. The conversation linked to arson went on for two to three months, Hui said. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins. fire bomb molotov November 18 Dylan Hollingsworth yau ma tei The SUCK Channel on Telegram, with a message saying some content has been removed by the police. Photo: Telegram screenshot. Telegram channels enable users to broadcast messages to multiple users simultaneously. Like on social media, users need to subscribe to your channel to get access to your content published by one or more administrators.
from us


Telegram 🔴 ANDROID PROGRAMMING CHANNEL
FROM American