is a date

Mike Kerner MikeKerner at roadrunner.com
Mon Oct 16 14:08:16 EDT 2017


Did I miss someone checking if the allegedly valid date is really a valid
date?  I don't think 99/99/99 is valid.

On Mon, Oct 16, 2017 at 2:07 PM, Mike Kerner <MikeKerner at roadrunner.com>
wrote:

> HEY BOB COPYCAT!
>
> On Mon, Oct 16, 2017 at 1:34 PM, Bob Sneidar via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> May want to check out the MasterLibrary then. It's got a lot of great
>> commands and functinos, one of which will format a date any way you like,
>> including sql date.
>>
>> Bob S
>>
>>
>> > On Oct 16, 2017, at 10:14 , Andrew Bell via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>> >
>> >> From: Bob Sneidar <bobsneidar at iotecdigital.com>
>> >> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> >> Subject: Re: is a date
>> >> Message-ID: <6EB529A3-5D21-4186-BD90-641746E96734 at 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 datetime formats look like this:
>> >>
>> >> yyyy-dd-mm hh:mm:ss
>> >>
>> >> Bob S
>> >>
>> >
>> > It mattered to me recently on a project I was working on so I wrote
>> these two scripts to help me generate a LC version of the mySQL version of
>> "timestamp":
>> >
>> > on timeStamp
>> >   put the internet date into tTheDate
>> >   convert tTheDate to dateitems
>> >   put item 1 of tTheDate into tYear
>> >   put item 2 of tTheDate into tMonth
>> >   put item 3 of tTheDate into tDay
>> >   put item 4 of tTheDate into tHour
>> >   put item 5 of tTheDate into tMinute
>> >   put item 6 of tTheDate into tSecond
>> >
>> >   leadingZero tMonth
>> >   leadingZero tDay
>> >   leadingZero tHour
>> >   leadingZero tMinute
>> >   leadingZero tSecond
>> >
>> >   put tYear & "-" & tMonth & "-" & tDay && tHour & ":" & tMinute & ":"
>> & tSecond into tTimeStamp
>> >   return tTimeStamp
>> > end timeStamp
>> >
>> > on leadingZero @pDateItem
>> >   if the length of pDateItem = 1 then
>> >      put "0" before pDateItem
>> >   end if
>> > end leadingZero
>> >
>> >
>> > A new date/time format of "database" would be useful for something like
>> this.
>> >
>> > --Andrew Bell
>> >
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list