Sergio Castellari Active Member Licensed User Longtime User Aug 16, 2021 #1 Hello, Assuming the following case: B4X: Copy nVence = DateTime.DateParse(DateTime.Date(row(1))) 'Obtengo SOLO la Fecha (DateParse) del Vencimiento nHoy = DateTime.DateParse(DateTime.Date(DateTime.Now)) 'Obtengo SOLO la Fecha actual nDias = nVence - nHoy 'Obtengo DIAS del vencimiento nDays returns TICKS (or that's what I think) and what I need is to get the DAYS difference between these dates
Hello, Assuming the following case: B4X: Copy nVence = DateTime.DateParse(DateTime.Date(row(1))) 'Obtengo SOLO la Fecha (DateParse) del Vencimiento nHoy = DateTime.DateParse(DateTime.Date(DateTime.Now)) 'Obtengo SOLO la Fecha actual nDias = nVence - nHoy 'Obtengo DIAS del vencimiento nDays returns TICKS (or that's what I think) and what I need is to get the DAYS difference between these dates
M Mahares Expert Licensed User Longtime User Aug 16, 2021 #2 Sergio Castellari said: I need is to get the DAYS difference between these dates Click to expand... Use DateUtils: Code: Copy Dim p As Period = DateUtils.PeriodBetweenInDays(DateTime.DateParse("8/12/2021"), DateTime.Now) Log(p.Days) Log(p.Hours) Log(p.Minutes)[code] Upvote 0
Sergio Castellari said: I need is to get the DAYS difference between these dates Click to expand... Use DateUtils: Code: Copy Dim p As Period = DateUtils.PeriodBetweenInDays(DateTime.DateParse("8/12/2021"), DateTime.Now) Log(p.Days) Log(p.Hours) Log(p.Minutes)[code]
Sergio Castellari Active Member Licensed User Longtime User Aug 16, 2021 #3 Mahares said: Use DateUtils: Code: Copy Dim p As Period = DateUtils.PeriodBetweenInDays(DateTime.DateParse("8/12/2021"), DateTime.Now) Log(p.Days) Log(p.Hours) Log(p.Minutes)[code] Click to expand... Thanks @Mahares !!! Upvote 0
Mahares said: Use DateUtils: Code: Copy Dim p As Period = DateUtils.PeriodBetweenInDays(DateTime.DateParse("8/12/2021"), DateTime.Now) Log(p.Days) Log(p.Hours) Log(p.Minutes)[code] Click to expand... Thanks @Mahares !!!