This is actually one of those things that sounds simple until you actually
implement it. Little things like people that use a different format -
DD/MM/YY instead of MM/DD/YY. If you create a custom edit control that only
allows two digits in between each slash, this has a chance of working. Then
again, a user forced to enter "01" instead of just "1", or made to tap three
different times on a control to enter "1/1/00" isn't going to be a happy
user. If you're not going to enforce this kind of input filtering, then you
have to be ready for people that'll do MM-DD-YY or MM-DD-YYYY or DD-MM-YYYY
or ....
See what I mean? Ugliness pronto.. Makes me appreciate the built-in
control for prompting for date/times.
-P
-----Original Message-----
From: P. Alan Johnson [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 30, 2000 8:41 AM
To: Palm Developer Forum
Subject: RE: Simple (?) question about dates and strings
Why not simply pick off the month, day, year characters then turn them into
ints and set the members of the DateTimeType struct yourself? Seems the
easiest way to me.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ken
> Krugler
> Sent: Friday, September 29, 2000 10:45 AM
> To: Palm Developer Forum
> Cc: [EMAIL PROTECTED]
> Subject: Re: Simple (?) question about dates and strings
>
>
> At 12:00am -0700 00-09-29, Palm Developer Forum digest wrote:
> >Subject: Simple (?) question about dates and strings
> >From: "wheeler wood" <[EMAIL PROTECTED]>
> >Date: Thu, 28 Sep 2000 22:57:49 -0400
> >X-Message-Number: 100
> >
> >Have I missed something? I need to convert a CharPtr (eg.
> "09/28/00") to a
> >DateTimeType. Is there a function that does this? I see the reverse is
> >available to create a string based on a date. Thanks.
>
> Nope, you're on your own. Note that Palm OS software typically uses
> the SelectDay() routine, which avoids having to parse manually
> entered date strings.
>
> -- Ken
>
> Ken Krugler
> TransPac Software, Inc.
> <http://www.transpac.com>
> +1 530-470-9200
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/