J javiers Active Member Licensed User Longtime User Apr 3, 2020 #1 For the same value of ticks DateTime.now, different dates are obtained in the number of minutes: 10:40:21 and 10:04:21 Entrada en t 1585903221333 Entrada string 10:40:21 Entrada completo 03/04/2020 10:04:21 B4X: DateTime.DateFormat = "dd/MM/yyyy hh:MM:ss" timer1.Initialize("Timer1", 5000) timer1.Enabled = True horaEntradaT = DateTime.Now horaEntrada = DateTime.Time(DateTime.Now) Log("Entrada en t " & horaEntradaT) Log("Entrada string " & horaEntrada) Log("Entrada completo " & DateTime.Date(horaEntradaT))
For the same value of ticks DateTime.now, different dates are obtained in the number of minutes: 10:40:21 and 10:04:21 Entrada en t 1585903221333 Entrada string 10:40:21 Entrada completo 03/04/2020 10:04:21 B4X: DateTime.DateFormat = "dd/MM/yyyy hh:MM:ss" timer1.Initialize("Timer1", 5000) timer1.Enabled = True horaEntradaT = DateTime.Now horaEntrada = DateTime.Time(DateTime.Now) Log("Entrada en t " & horaEntradaT) Log("Entrada string " & horaEntrada) Log("Entrada completo " & DateTime.Date(horaEntradaT))
DonManfred Expert Licensed User Longtime User Apr 3, 2020 #2 javiers said: DateTime.DateFormat = "dd/MM/yyyy hh:MM:ss" Click to expand... MONTH is the same value as MINUTE? SimpleDateFormat (Java Platform SE 7 ) Try it with B4X: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss" Upvote 0
javiers said: DateTime.DateFormat = "dd/MM/yyyy hh:MM:ss" Click to expand... MONTH is the same value as MINUTE? SimpleDateFormat (Java Platform SE 7 ) Try it with B4X: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss"
J javiers Active Member Licensed User Longtime User Apr 3, 2020 #3 DonManfred said: MONTH is the same value as MINUTE? SimpleDateFormat (Java Platform SE 7 ) Try it with B4X: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss" Click to expand... Thank you!! I've noticed. The error is in: DateTime.DateFormat = "dd / MM / yyyy hh: MM: ss" Must be : DateTime.DateFormat = "dd / MM / yyyy hh: mm: ss" Upvote 0
DonManfred said: MONTH is the same value as MINUTE? SimpleDateFormat (Java Platform SE 7 ) Try it with B4X: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss" Click to expand... Thank you!! I've noticed. The error is in: DateTime.DateFormat = "dd / MM / yyyy hh: MM: ss" Must be : DateTime.DateFormat = "dd / MM / yyyy hh: mm: ss"
ilan Expert Licensed User Longtime User Apr 3, 2020 #4 DonManfred said: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss" Click to expand... as far as i know hours should be with capital HH like this: "HH:mm:ss" Upvote 0
DonManfred said: DateTime.DateFormat = "dd/MM/yyyy hh:mm:ss" Click to expand... as far as i know hours should be with capital HH like this: "HH:mm:ss"
DonManfred Expert Licensed User Longtime User Apr 3, 2020 #5 i did not check everything... i just saw the same MM for months and minutes... H Hour in day (0-23) You are surely right that this is wrong too Upvote 0
i did not check everything... i just saw the same MM for months and minutes... H Hour in day (0-23) You are surely right that this is wrong too
klaus Expert Licensed User Longtime User Apr 3, 2020 #6 "HH:mm:ss" is 24 hours > 13:12:23 "hh:mm:ss" is 12 hours > 01:12:23 "hham:mm:ss" is 12 hours with AM/PM > 01PM12:23 "am:mm:ss" is 12 hours with AM/PM > 01PM12:23 Upvote 0
"HH:mm:ss" is 24 hours > 13:12:23 "hh:mm:ss" is 12 hours > 01:12:23 "hham:mm:ss" is 12 hours with AM/PM > 01PM12:23 "am:mm:ss" is 12 hours with AM/PM > 01PM12:23