check if an item is a date

MisterX b.xavier at internet.lu
Thu Mar 17 13:52:07 EST 2005


> Want to be even more flexible?  Try this:
> 
> convert myvalue to long date
> if it is "invalid date" then
>    answer "That date is invalid!"
> else
>    put it into myvalue
> end if
> 

Good solution! Nice...

For extended formats, the format function is probably the best all around
tool

put format(mydateformat,idealdata) into thisformatedstring
if format(mydateformat,mydata) is not thisformatedstring then

something like that... I'll sleep on it...

maybe there's a grep way too...

put Shell("PERL" && quoteit(isdate($mydata))) into isvalidformateddata

;)

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Frank D. Engel, Jr.
> Sent: Thursday, March 17, 2005 18:16
> To: How to use Revolution
> Subject: Re: check if an item is a date
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Want to be even more flexible?  Try this:
> 
> convert myvalue to long date
> if it is "invalid date" then
>    answer "That date is invalid!"
> else
>    put it into myvalue
> end if
> 
> This will convert other recognized date formats into the long 
> date format and replace the original data with that, 
> complaining if the input date is invalid.
> 
> You can replace 'long date' with 'system long date' to force 
> use of the OS's defined long date format, but note that I 
> seem to have come across a problem with this that sticks a 
> leading zero on the day number, even though my system prefs 
> do not call for one.
> 
> You can also replace 'long' with 'short', or whatever...
> 
> 
> On Mar 17, 2005, at 11:52 AM, Rob Cozens wrote:
> 
> > Jacque, et al,
> >
> >> I see seconds & fixed notations (yours + Julian + whatever) as
> >> non-sequitur:
> >
> > To put it another way: For user input validation, a date is 
> valid ONLY 
> > if it conforms to the computer's current system date format.
> >
> > Rob Cozens, Staff Conservator
> > Mendonoma Marine Life Conservancy
> >
> > "Fishermen are living off capital,consuming the resource 
> that should 
> > yield their catch.
> >
> > The Economist, March 1994
> >
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
> >
> - -----------------------------------------------------------
> Frank D. Engel, Jr.  <fde101 at fjrhome.net>
> 
> $ ln -s /usr/share/kjvbible /usr/manual
> $ true | cat /usr/manual | grep "John 3:16"
> John 3:16 For God so loved the world, that he gave his only 
> begotten Son, that whosoever believeth in him should not 
> perish, but have everlasting life.
> $
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (Darwin)
> 
> iD8DBQFCObs07aqtWrR9cZoRAiQNAJsFDNxEkFOWbY9CZB/MtHoCKw7mQgCfQTZl
> u7ZtsnLuPbXfihJUyJg1FQA=
> =U3b6
> -----END PGP SIGNATURE-----
> 
> 
> 
> ___________________________________________________________
> $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 
> 10 Personalized POP and Web E-mail Accounts, and much more.
> Signup at www.doteasy.com
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list