R ronovar Active Member Licensed User Longtime User Mar 25, 2016 #1 I have using this to show Hours:Minutes B4X: lblTime.Text = DateTime.GetHour(DateTime.Now)&":"& DateTime.GetMinute(DateTime.Now) That works fine if minutes does not have zeros before...for example this is show correctly: 12:15 12:25 12:35 But when time is: 12:05 12:08 12:01 it is show: 12:5 12:8 12:1 and so on...how to fix this?
I have using this to show Hours:Minutes B4X: lblTime.Text = DateTime.GetHour(DateTime.Now)&":"& DateTime.GetMinute(DateTime.Now) That works fine if minutes does not have zeros before...for example this is show correctly: 12:15 12:25 12:35 But when time is: 12:05 12:08 12:01 it is show: 12:5 12:8 12:1 and so on...how to fix this?
klaus Expert Licensed User Longtime User Mar 25, 2016 #2 Use TimeFormat: B4X: DateTime.TimFormat = "HH:mm" lblTime.Text = Date.Time(DateTime.Now) Upvote 0
R ronovar Active Member Licensed User Longtime User Mar 25, 2016 #3 Thanks. This works as expected. Last edited: Mar 25, 2016 Upvote 0