rleiman Well-Known Member Licensed User Longtime User Dec 19, 2011 #1 Hi Everyone, I get strange numbers from using DateTime. B4X: intTheCurrentDateTime = DateTime.Now intHour = DateTime.GetHour(intTheCurrentDateTime) intMinute = DateTime.GetMinute(intTheCurrentDateTime) intSeconds = DateTime.GetSecond(intTheCurrentDateTime) ToastMessageShow("Hours: " & intHour, False) ToastMessageShow("Minutes: " & intMinute, False) The toast give me 19 when the real time was 13. Looks like it went ahead 6 hours. If I do the same with minutes, it goes ahead 19 minutes. Is this a bug? Am I using DateTime the wrong way? Thanks.
Hi Everyone, I get strange numbers from using DateTime. B4X: intTheCurrentDateTime = DateTime.Now intHour = DateTime.GetHour(intTheCurrentDateTime) intMinute = DateTime.GetMinute(intTheCurrentDateTime) intSeconds = DateTime.GetSecond(intTheCurrentDateTime) ToastMessageShow("Hours: " & intHour, False) ToastMessageShow("Minutes: " & intMinute, False) The toast give me 19 when the real time was 13. Looks like it went ahead 6 hours. If I do the same with minutes, it goes ahead 19 minutes. Is this a bug? Am I using DateTime the wrong way? Thanks.
klaus Expert Licensed User Longtime User Dec 19, 2011 #2 Two questions: - did you set the time correctly on the device or emulator. - did you Dim intTheCurrentDateTime As Int ? it must be Dim intTheCurrentDateTime As Long ! Best regards. Upvote 0
Two questions: - did you set the time correctly on the device or emulator. - did you Dim intTheCurrentDateTime As Int ? it must be Dim intTheCurrentDateTime As Long ! Best regards.
rleiman Well-Known Member Licensed User Longtime User Dec 20, 2011 #3 Thanks. It was an Int instead of Long. klaus said: Two questions: - did you set the time correctly on the device or emulator. - did you Dim intTheCurrentDateTime As Int ? it must be Dim intTheCurrentDateTime As Long ! Best regards. Click to expand... Upvote 0
Thanks. It was an Int instead of Long. klaus said: Two questions: - did you set the time correctly on the device or emulator. - did you Dim intTheCurrentDateTime As Int ? it must be Dim intTheCurrentDateTime As Long ! Best regards. Click to expand...