handle cancel button iphonePickDate
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
handle cancel button iphonePickDate
how can you handle the cancel button in iphonePickDate dialog
if I press the cancel button I receive "10/10/70 :01.00" back
can I be sure that all users will receive this back ?
if I press the cancel button I receive "10/10/70 :01.00" back
can I be sure that all users will receive this back ?
Re: handle cancel button iphonePickDate
We have a special iOS forum, please use this for all iOS related question (beginner or not).
Will move this post now (just like your previous one
)
Will move this post now (just like your previous one

Re: handle cancel button iphonePickDate
Hi,
the documentation is a bit ambiguous on this:
at one place it says that the return value contains 0 if the user canceled, at another place that the return value is "cancel" if the user canceled.
So best would be if you test the result for "cancel" and also for "0" to catch a cancel event before converting to date && time.
I would expect that you get 01/01/70 :01:00
This is because I guess your computer is set to a time zone UTC +1, hence 01:00 instead of 00:00 which would show up if you would set your computer time zone to Greenwich Mean Time = UTC. This is not taking into account Daylight saving time.
Kind regards
Bernd
the documentation is a bit ambiguous on this:
at one place it says that the return value contains 0 if the user canceled, at another place that the return value is "cancel" if the user canceled.
So best would be if you test the result for "cancel" and also for "0" to catch a cancel event before converting to date && time.
I would expect that you get 01/01/70 :01:00
This is because I guess your computer is set to a time zone UTC +1, hence 01:00 instead of 00:00 which would show up if you would set your computer time zone to Greenwich Mean Time = UTC. This is not taking into account Daylight saving time.
Kind regards
Bernd
Re: handle cancel button iphonePickDate
Hi Bernd
Thanks for your help
both "0" and "cancel" is a no go
any other ideas
Thanks for your help
both "0" and "cancel" is a no go
any other ideas

Re: handle cancel button iphonePickDate
I would make a field and put the result into the field. Then you would know what the result contains when you do different actions.
Kind regards
Bernd
Kind regards
Bernd
Re: handle cancel button iphonePickDate
Hi Bernd
thanks for your help !!
I did and I get 01/01/70 :01:00 every time I press cancel
My problem is I can't check for all countries with different timezones
thanks for your help !!
I did and I get 01/01/70 :01:00 every time I press cancel
My problem is I can't check for all countries with different timezones
Re: handle cancel button iphonePickDate
If you convert the result to seconds you get 0, which is the begin of the unix epoch. You don't have to worry about time zones. It will always be zero.
but beware: for the ipad you have to explicitly set the cancel/done option. Otherwise a click outside of the pickWheel without selection will return the current date/time.
Kind regards
Bernd
but beware: for the ipad you have to explicitly set the cancel/done option. Otherwise a click outside of the pickWheel without selection will return the current date/time.
Kind regards
Bernd
Re: handle cancel button iphonePickDate
Hi Bernd
You are the man !!
thanks a lot !
You are the man !!
thanks a lot !