0
Next, I get a data json from an api:
"data": "2021-05-03T14:07:19.000Z"
need convert to show user...
I made my data class with her: Data : Date
no Adapter called it with a function that goes back to the data class like this:
fun Date.formatte(): String =
android.icu.text.SimpleDateFormat("dd/MM/yy - HH:mm ", Locale("pt-br", "America/Sao_Paulo"))
.format(this)
at last it returns,the correct time and date but with 3 Hours less...what I am doing wrong?
Hello Gabriel, I think the date that comes in JSON is without GMT, and you are applying GMT in your conversion. That’s why the time difference.
– ooredroxoo
Opa hasn’t worked yet!
– Gabriel Felski