guidoarfini Member Licensed User Longtime User Mar 16, 2012 #1 i have create litte app for datetime, but don't work in correct modo becose when change the day.... :BangHead: this app using database ( in this example editext) for day and time start and finsh stored... can you help me? Attachments datetime.zip datetime.zip 8.3 KB · Views: 362
i have create litte app for datetime, but don't work in correct modo becose when change the day.... :BangHead: this app using database ( in this example editext) for day and time start and finsh stored... can you help me?
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2012 #2 We will need more information. What are the steps to see the error? What is exactly the error? Upvote 0
guidoarfini Member Licensed User Longtime User Mar 18, 2012 #3 quando faccio partire un tempo a coundown e questo finisce il giorno dopo, il conteggio del tempo rimanente risulta essere sbagliato di 12 ore; a time when I start to coundown and this ends the next day, the count of the remaining time turns out to be wrong in 12 hours; Upvote 0
quando faccio partire un tempo a coundown e questo finisce il giorno dopo, il conteggio del tempo rimanente risulta essere sbagliato di 12 ore; a time when I start to coundown and this ends the next day, the count of the remaining time turns out to be wrong in 12 hours;
Ricky D Well-Known Member Licensed User Longtime User Mar 20, 2012 #4 I'm a novice on android but let's say you have this Code: Copy Dim start, theend, diff As Long start = Datetime. Now 'do some code thend = Datetime.Now diff = thend - start 'now calculate the hours, minutes & seconds 'diff/1000 gets rid of the milliseconds to take care of different days get the day count * 24 to get the extra hours to add to the hours of the time portion I'll try it when I get up after ending work regards Ricky Upvote 0
I'm a novice on android but let's say you have this Code: Copy Dim start, theend, diff As Long start = Datetime. Now 'do some code thend = Datetime.Now diff = thend - start 'now calculate the hours, minutes & seconds 'diff/1000 gets rid of the milliseconds to take care of different days get the day count * 24 to get the extra hours to add to the hours of the time portion I'll try it when I get up after ending work regards Ricky
guidoarfini Member Licensed User Longtime User Mar 20, 2012 #6 this a problem now i have update my app, but these are the problems; example: time to insert de service are 20:00 of day1 i can insert work countdown 00:20:00 or insert countdown of 02:00:00; app calcolate in correct mode the day and hours correct finsh:sign0098: but time to insert the servis are 00:01:00 of day2 don't work, the app don't calculate the time of finish work:BangHead: sorry for my english Attachments dataora.zip dataora.zip 8.7 KB · Views: 336 Upvote 0
this a problem now i have update my app, but these are the problems; example: time to insert de service are 20:00 of day1 i can insert work countdown 00:20:00 or insert countdown of 02:00:00; app calcolate in correct mode the day and hours correct finsh:sign0098: but time to insert the servis are 00:01:00 of day2 don't work, the app don't calculate the time of finish work:BangHead: sorry for my english
guidoarfini Member Licensed User Longtime User Mar 21, 2012 #7 help me if it's 23:50 when I start the service calculates the hours and the correct date the service ends, while if it's 00:01, do not calculate correctly the day of service ends. for example: the value of comDurataServizio.text = "00:20:00" Adesso = DateTime.now : GiornoAttuale = DateTime.Date(Adesso) OraAttuale = DateTime.Time(Adesso) DurataSER = ComDurataServizio.Text PrimoDuePunti = DurataSER.IndexOf(":") OreDaAgg = DurataSER.SubString2(0, PrimoDuePunti) SecondoDuePunti = DurataSER.LastIndexOf(":") MinDaAgg = DurataSER.SubString2(PrimoDuePunti + 1, SecondoDuePunti) SecDaAgg = DurataSER.SubString2(SecondoDuePunti + 1, DurataSER.Length) MillisecondiDaAgg = DateTime.TicksPerHour * OreDaAgg + DateTime.TicksPerMinute * MinDaAgg + DateTime.TicksPerSecond * SecDaAgg TempoScadenza = DateTime.TimeParse(OraAttuale) + MillisecondiDaAgg GiornoScadenza = DateTime.Date(TempoScadenza) OraScadenza = DateTime.Time(TempoScadenza) ComIniConsumazione.Text=OraAttuale comFineConsumazione.Text=OraScadenza FinServGiorno=GiornoScadenza Upvote 0
help me if it's 23:50 when I start the service calculates the hours and the correct date the service ends, while if it's 00:01, do not calculate correctly the day of service ends. for example: the value of comDurataServizio.text = "00:20:00" Adesso = DateTime.now : GiornoAttuale = DateTime.Date(Adesso) OraAttuale = DateTime.Time(Adesso) DurataSER = ComDurataServizio.Text PrimoDuePunti = DurataSER.IndexOf(":") OreDaAgg = DurataSER.SubString2(0, PrimoDuePunti) SecondoDuePunti = DurataSER.LastIndexOf(":") MinDaAgg = DurataSER.SubString2(PrimoDuePunti + 1, SecondoDuePunti) SecDaAgg = DurataSER.SubString2(SecondoDuePunti + 1, DurataSER.Length) MillisecondiDaAgg = DateTime.TicksPerHour * OreDaAgg + DateTime.TicksPerMinute * MinDaAgg + DateTime.TicksPerSecond * SecDaAgg TempoScadenza = DateTime.TimeParse(OraAttuale) + MillisecondiDaAgg GiornoScadenza = DateTime.Date(TempoScadenza) OraScadenza = DateTime.Time(TempoScadenza) ComIniConsumazione.Text=OraAttuale comFineConsumazione.Text=OraScadenza FinServGiorno=GiornoScadenza