You are completely welcome! Sarah is one of the sharper knives in the
drawer (and community-minded). I'm not sure if she still reads the list
but she is missed.
Phil
On 5/24/12 5:09 PM, Igor de Oliveira Couto wrote:
Dear Phil,
Thank you *so much* for this link:
On 24/05/2012, at 10:51 AM,
Dear Phil,
Thank you *so much* for this link:
On 24/05/2012, at 10:51 AM, Phil Davis wrote:
> Another good resource for date & time calcs is Sarah Reichelt's DateTime.rev
> library, which is pure LC:
>
>http://www.troz.net/rev/index.irev?category=Library#stacks
>
That is some very useful
Another good resource for date & time calcs is Sarah Reichelt's
DateTime.rev library, which is pure LC:
http://www.troz.net/rev/index.irev?category=Library#stacks
Phil Davis
On 5/23/12 5:42 PM, Igor de Oliveira Couto wrote:
Peter, thank you very much for the sqlite-based answers:
On 24/
Peter, thank you very much for the sqlite-based answers:
On 24/05/2012, at 2:17 AM, Peter Haworth wrote:
> Sorry about that Igor, not sure why it didn't make it. Anyway, here it is
> again.
[...]
Indeed, it may be easier to let an external lib handle the date calculations,
considering that it
Sorry about that Igor, not sure why it didn't make it. Anyway, here it is
again.
AGE CALCULATION (using 1945-07-06 as the birth date):
SELECT (strftime('%Y','now') - strftime('%Y','1945-07-06')) -
(strftime('%m'-%d','now') < strftime('%m-%d','1945-07-06'));
CLOSE TO (Using 2012-05-30 as the ann
On 23/05/2012, at 3:50 PM, Peter Haworth wrote:
> I don't know the answer to your question about dates prior to 1970 on
> Windows machines, but I do know that problem doesn't exist with the sqlite
> solution I posted.
[...]
Peter, I went through my mail again to make sure, and I can't seem to fi
HI Igor,
I don't know the answer to your question about dates prior to 1970 on
Windows machines, but I do know that problem doesn't exist with the sqlite
solution I posted. You don't even have to have an sqlite database
available to you, just call revOpenDatabase with ":memory:" as the file
path.
Many thanks for all the suggestions - and I did learn a couple of new tricks
from your code, too! I had not realised that there could be an issue with
pre-1970 dates in Windows, and also did not know that we had to watch out for
the 'centuryCutoff' property. Very, very useful to know.
Peter's c
Sorry, I copied and pasted an older version of the handler. Try this:
function doAge tDate,asOf
-- returns the age given birthdate =
-- as of the date (if empty, assumes today)
if tDate = empty then return empty
if asOf = empty then
put the date into asOf
end if
set the i
Wasn't there a recent post that indicated this would not work? Anything before
a certain date (I forget what it was) would be a day off?
Bob
On May 21, 2012, at 9:38 AM, Peter M. Brigham, MD wrote:
> Here's what I use for #1:
>
> function doAge tDate,asOf
> -- return the age given birthdate
Here's what I use for #1:
function doAge tDate,asOf
-- return the age given birthdate =
-- as of the date (if empty, assumes today)
convert tDate to dateItems
if asOf = empty then
put the date into asOf
end if
convert asOf to dateitems
put item 1 of asOf - item 1 of tD
Bonjour Igor,
Le 21 mai 2012 à 09:02, Igor de Oliveira Couto a écrit :
> Dear LC Folks,
>
> What is the 'best' way to perform these 2 calculations with LiveCode?
>
> 1) Calculate a person's age, given a birthdate:
I had problems with scripts mainly based on "convert to seconds" and "dateItems
On 21/05/2012 08:02, Igor de Oliveira Couto wrote:
What is the 'best' way to perform these 2 calculations with LiveCode?
'convert' just rocks. Here's a couple of throwaways to show you how I'd
approach it. They probably aren't exactly what you need, but you'll get
the idea.
1) Calculate
Dear LC Folks,
What is the 'best' way to perform these 2 calculations with LiveCode?
1) Calculate a person's age, given a birthdate:
/*
Calculates the number of birthdays from a given date, up to and including
*today*.
@param pBirthDate the birthdate
@return a positive integer represen
14 matches
Mail list logo