H helmut25 Member Oct 10, 2021 #1 I am desperately trying to get the current time and date, without success ;-( this is my code (b4xpages) B4X: DateTime.TimeFormat = "hh:mm" DateTime.DateFormat = "dd.MMM.yyyy" datex = DateTime.Time(DateTime.Now) the variable datex remains empty. I included the DateUtils library, but to no avail. the compiler doesn't even throw an error messge. any suggestions?
I am desperately trying to get the current time and date, without success ;-( this is my code (b4xpages) B4X: DateTime.TimeFormat = "hh:mm" DateTime.DateFormat = "dd.MMM.yyyy" datex = DateTime.Time(DateTime.Now) the variable datex remains empty. I included the DateUtils library, but to no avail. the compiler doesn't even throw an error messge. any suggestions?
Erel B4X founder Staff member Licensed User Longtime User Oct 10, 2021 #2 What is the output of Log(datex) ? Upvote 0
H helmut25 Member Oct 10, 2021 #3 Erel said: What is the output of Log(datex) ? Click to expand... thanx for your very quick answer. I was just about to delete my question, because i found out that I had to include the XUI Views library instead of the DateUtils library.....there obviously is no documentation about that. Upvote 0
Erel said: What is the output of Log(datex) ? Click to expand... thanx for your very quick answer. I was just about to delete my question, because i found out that I had to include the XUI Views library instead of the DateUtils library.....there obviously is no documentation about that.
M Mahares Expert Licensed User Longtime User Oct 10, 2021 #4 This definitely works: Code: Dim datex As String DateTime.TimeFormat = "hh:mm" DateTime.DateFormat = "dd.MMM.yyyy" datex = DateTime.Time(DateTime.Now) Log(datex) 'shows the current time without PM or AM Upvote 0
This definitely works: Code: Dim datex As String DateTime.TimeFormat = "hh:mm" DateTime.DateFormat = "dd.MMM.yyyy" datex = DateTime.Time(DateTime.Now) Log(datex) 'shows the current time without PM or AM
Erel B4X founder Staff member Licensed User Longtime User Oct 10, 2021 #5 helmut25 said: UI Views library instead of the DateUtils library.....there obviously is no documentation about that. Click to expand... This code doesn't depend on XUI Views nor does it depend on DateUtils. Upvote 0
helmut25 said: UI Views library instead of the DateUtils library.....there obviously is no documentation about that. Click to expand... This code doesn't depend on XUI Views nor does it depend on DateUtils.