Android Question Timedialog get am or pm from dialog

anaylor01

Well-Known Member
Licensed User
Longtime User
Then what is the point of being able to select am or pm on the 12 hour time dialog? Seems like a oversight.
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
Can someone please help me with this. I mean most people do not know 24 hour clock. Especially kids. So I need a way to know when they select AM or PM. Please help.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hi

You're using this? http://www.b4x.com/android/help/dialogs.html#timedialog

You'll have to do as I already said, give them a tick box to indicate am or pm and make sure they select one or allow it to default to one..

or if they push a button ask them a supplementary question about am or pm..
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
So the AM PM that they can select on a 12 hour clock is just for looks? That is rather stupid. So what you are saying is on a 12 hour clock they select the am pm and then they have to select an am pm again. So what I am thinking that only the 24 hour time dialog is useful. Which really isn't very useful since not a lot of people know military time. Isn't this something they could update to fix?
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
Maybe I am missing something. Yes the user selects the hour, the minutes and either AM or PM. But how do I know whether they selected AM OR PM? There is the timedialog.hour and timedialog.minute but no timedialog.ampm.
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
Yep. I was missing something. Sorry for the confusion. The time comes through in 24 hour which I knew that and I am not stoned. bummer.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had a look at the Android documentation and the TimePicker has no getCurrentAMPM method.
You need to use
- the TimeTicks and this TimeFormat DateTime.TimeFormat = "HH:mm a".
- and DateTime.Time(dial.TimeTicks) returns a string with the two last characters either AM or PM.
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
Please disregard all of this. I am stupid. If the user selects 11 and then pm the hour comes through as 2300. I knew that. Just a giant brain fart. Matter of fact you might just delete this whole thread.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Please disregard all of this. I am stupid. If the user selects 11 and then pm the hour comes through as 2300. I knew that. Just a giant brain fart. Matter of fact you might just delete this whole thread.

I wouldn't worry we've all had those sort of moments!!
 
Upvote 0
Top