Android Question one day behind on android 2.3.6

RomansUP

Member
Licensed User
Longtime User
Hi good people. I have got very strange problem.
I have to devices: samsung mobile phone with 2.3.6 Android and Asus Tab with 4.2.1 Android. I have wrote program on B4A 3.70 which contains dates fields. On Asus evrything is ok but on samsung after seting the date the date becomes one day behind. Moreover I tried to analiz situation and got srange result. This problem on samsung I get only if I set date up to 31.12.2010. After this date I do not catch this problem. The first version of my program I have wrote on B4A 3.2 or earlier. And I did't see this problem before. So may be someone have idias what is this?
Thanks
 

RomansUP

Member
Licensed User
Longtime User
Here you are

.apk was compiled on B4A 3.80. Try run it on Android 2.3.6
 

Attachments

  • datetest.zip
    6.4 KB · Views: 181
  • datetest.apk
    119.1 KB · Views: 180
Upvote 0

RomansUP

Member
Licensed User
Longtime User
Hi, Erel
Thanks for reply. As you see I use dd.DateTicks in previous code.
Well I have wrote small code which shows that problem or bug is not in DateDialog. Code shows that problem is in counting in DateTime.parse of day_of_month.
dd.DayOfMonth shows correct day, but after using DateTime.DateParse It's again shows one day behind.
Also I tried to run code on emulator on version Android 2.2. x there is no problem. It's seems to me it's only appearing on versions 2.3.x

===================
Sub dateset
Dim dd As DateDialog 'here Dialog v.2.91 library needs
Dim result As Long
Dim result2 As Int
DateTime.DateFormat="dd.MM.yyyy"
dd.SetDate(25,9,1970)
dd.show("Set Date please", "DATE DIALOG", "Ok","cancel","",Null)
result=DateTime.DateParse(dd.DayOfMonth&"."&dd.Month&"."&dd.Year)
result2=Msgbox2(DateTime.Date(result),"That is Date "&dd.DayOfMonth&"."&dd.Month&"."&dd.Year,"Ok","cancel","",Null)
If result2<>-1 Then dateset
End Sub
================

I understand that is not interesting to analize problems of very old Android versions But I just need the suggestion of workaround.
Thanks
 
Upvote 0

RomansUP

Member
Licensed User
Longtime User
The Answer is 24.09.1970
Moreover I used MsgBox to put on screen and File.WriteString to put on disk. Anycase - The answer is 24.09.1970 But only on Android 2.3.6
 
Upvote 0

RomansUP

Member
Licensed User
Longtime User
Time Zone is GMT+4:00. But device takes time automaticly from network. When I set GMT+0:00 manualy test program shows 25:09:1970 00:00:00
When I set manualy GMT+4:00 it's again shows 24.09.1970 23:00:00
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
There were some issues with the internal timetables of 2.3.

Maybe this could be the reason:

http://code.google.com/p/android/issues/detail?id=21377

"In 2011, the Russian government proclaimed that daylight saving time would in future be observed all year round, thus effectively displacing standard time—an action which the government claimed emerged from health concerns attributed to the annual shift back-and-forth between standard time and daylight saving time.[1] On 27 March 2011, Muscovites set their clocks forward for a final time, effectively observing MSD, or UTC+4, permanently."
 
Upvote 0
Top