One of my devices is giving the wrong date time. It is showing an hour ahead. How can I tell the date time variable to use the system local time.
B4X:
Sub QryDate As String
Try
If TD.IsInitialized=False Then
TD.Initialize
EndIf
Dim Year As String=TD.Year
Dim Month As String=TD.Month
Dim Day As String=TD.Day
Catch
oError.ShowLastException("Error QryDate")
EndTry
Return Year&Month&Day
End Sub
///Code for TD Initiatize
Public Sub Initialize
DateTime.DateFormat="MM/dd/yyyy"
PostDate=DateTime.Date(DateTime.Now)
Year =NumberFormat2(DateTime.GetYear(DateTime.DateParse(PostDate)),4,0,0,False)
Month =NumberFormat2(DateTime.GetMonth(DateTime.DateParse(PostDate)),2,0,0,False)
Day =NumberFormat2(DateTime.GetDayOfMonth(DateTime.DateParse(PostDate)),2,0,0,False)
End Sub
Last edited: