> put char 3 of the short system dateformat into tDelimiter
>
> else
>
> put char 3 of the short dateformat into tDelimiter
>
> end if
>
> if tDelimiter is in pDate and pDate is a date then return true
>
> return false
>
> end IsDate
>
> trevix
How about this:
function IsDate pDate, pSysDate
if pSysDate then
put char 3 of the short system dateformat into tDelimiter
else
put char 3 of the short dateformat into tDelimiter
end if
if tDelimiter is in pDate and pDate is a date then return true
return false
end IsDate
trevix
at 10:14 , Andrew Bell via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> >> From: Bob Sneidar
>> >> To: How to use LiveCode
>> >> Subject: Re: is a date
>> >> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iot
ng sql date.
>
> Bob S
>
>
> > On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> >> From: Bob Sneidar
> >> To: How to use LiveCode
> >> Subject: Re: is a date
> >> Message-
t; To: How to use LiveCode
>> Subject: Re: is a date
>> Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> This probably matters to no one at all, but SQL does not store dates with
From: Bob Sneidar
To: How to use LiveCode
Subject: Re: is a date
Message-ID: <6eb529a3-5d21-4186-bd90-641746e96...@iotecdigital.com>
Content-Type: text/plain; charset="us-ascii"
This probably matters to no one at all, but SQL does not store dates
with forward slashes. SQL
Again, I would prefer a simple one-liner built-in function. What if
instead of "is a date" returning true or false, it instead returned some
expected outputs like "short, long, internet, seconds, ect.". Something
short and sweet.
~Roger
On Mon, Oct 16, 2017 at 12:56 PM,
This probably matters to no one at all, but SQL does not store dates with
forward slashes. SQL datetime formats look like this:
-dd-mm hh:mm:ss
Bob S
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe,
return theDate
end formatDate
Bob S
> On Oct 16, 2017, at 09:47 , Bob Sneidar wrote:
>
> Old trick I learned in Foxpro. Convert something then convert it back and see
> if it is identical.
>
> put 20 into tDate
> put tDate into tOldDate
> convert tDate to da
Old trick I learned in Foxpro. Convert something then convert it back and see
if it is identical.
put 20 into tDate
put tDate into tOldDate
convert tDate to dateitems
convert tDate to short date
return ((tDate is a date) and (tDate is tOldDate))
Bob S
Exactly! I was elated to find the built-in "is a date" check, because I
really wanted to NOT have to roll my own. I was THRILLED that our lovely
English-like syntax was working FOR me. And then an integer was accepted
as a legit date. I didn't like that at all. Why can't t
> JLG wrote ...
> The one exception may be that any _integer_ is considered a date.
> To get around that we could just check that there are 3 items
> delimited by slashes before testing for "is a date".
I write "is a /real/ date" into my notes whenever a meeting i
-Ursprüngliche Nachricht-
Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im Auftrag
von J. Landman Gay via use-livecode
Gesendet: Sonntag, 15. Oktober 2017 22:38
An: How to use LiveCode
Cc: J. Landman Gay
Betreff: Re: is a date
>> To get around that we coul
Roger wrote:
>
> put "11/20/2017" is a date
> returns true
> ----
> put "10" is a date
> returns true
>
> put "raccoon" is a date
> returns false
>
>
> WHY is "10" seen as a date?
Because it is legitimately a
-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> Or x is a date and x is not an integer ?
>>
>> -- Alex.
>>
>>
>> On 15/10/2017 21:37, J. Landman Gay via use-livecode wrote:
>>
>>> You know, after all the dicussion here, I
Yeah. Unless you require a year or something, that'd work.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On October 15, 2017 4:23:20 PM Alex Tweedly via use-livecode
wrote:
Or x is a date and x i
Or x is a date and x is not an integer ?
-- Alex.
On 15/10/2017 21:37, J. Landman Gay via use-livecode wrote:
You know, after all the dicussion here, I'm not sure any of the
options are better than "x is a date". The one exception may be that
any integer is considered
You know, after all the dicussion here, I'm not sure any of the options
are better than "x is a date". The one exception may be that any integer
is considered a date. To get around that we could just check that there
are 3 items delimited by slashes before testing
n 10/15/17 5:10 AM, Yves COPPE via use-livecode wrote:
>>> I hope this works for any date format
>> ...
>>>
>>> if
>>> matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheMonth,TheYear)
>>> is true then
>> Yes, it see
ot;,theDay,TheMonth,TheYear)
is true then
Yes, it seems to work with any numeric date now.
It *does* think 99/99/00 is a date, though.
Ah. I didn't test that.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hy
k with any numeric date now.
It *does* think 99/99/00 is a date, though.
--
Mark Wieder
ahsoftw...@gmail.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
p
On 10/15/17 5:10 AM, Yves COPPE via use-livecode wrote:
I hope this works for any date format
...
if
matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheMonth,TheYear)
is true then
Yes, it seems to work with any numeric date now. I also like Ken Ray's
solution which lets the
Hi,
I hope this works for any date format
on mouseUp
ask "Give a date"
if it is empty then exit to top
answer IsDate(it)
end mouseUp
function IsDate textToSearch
local theDay, TheMonth, TheYear
put empty into tresult
if
matchtext(textToSearch,"(\d{1,2})/(\d{1,2})/(\d{2,4})",theDay,TheM
What about this from the Master Library from Ken Ray?
function isDate pWhat
/* isDate Date
Syntax:
isDate (pWhat)
Examples:
isDate("10/10/2001")
Description:
Determines if the container passed to it in contains a valid
date.
Returns true or false.
Source:
Ken Ra
On 10/14/17 2:14 PM, Yves COPPE via use-livecode wrote:
Try this
function CheckDate pDateToCheck
return
matchText(pDateToCheck,"([1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0-9][0-9][0-9])")
end CheckDate
Promising, but fails with dates like "1/1/19".
--
Jacqueline Landman Gay |
;s what I suspected. So to build a slightly better trap, I am doing
> this:
>
> if tDate is a date and length(tDate) > 5 and tDate contains "/" then
> put "true"
> else
> put "false"
> end if
>
> I am sure there is probably a standard
That's what I suspected. So to build a slightly better trap, I am doing
this:
if tDate is a date and length(tDate) > 5 and tDate contains "/" then
put "true"
else
put "false"
end if
I am sure there is probably a standard way to catch all possibl
Hi Roger,
> Am 14.10.2017 um 18:30 schrieb Roger Eller via use-livecode
> :
>
> put "11/20/2017" is a date
> returns true
>
> put "10" is a date
> returns true
>
> put "raccoon" is a date
> returns false
>
>
&
put "11/20/2017" is a date
returns true
put "10" is a date
returns true
----
put "raccoon" is a date
returns false
WHY is "10" seen as a date?
~Roger
___
use-livecode mailing list
use-livecode@l
29 matches
Mail list logo