Why isn't this a date?

Jim Ault JimAultWins at yahoo.com
Tue Sep 25 16:42:13 EDT 2007


On 9/25/07 1:23 PM, "Mikey" <mikeythek at gmail.com> wrote:
> Well, I tried setting the century cutoff to 40 and to 10 and it
> doesn't work for either, regardless of whether I have the year
> prepended with "19" or not.

I have to add that running commands etc from the message box does not always
work.  The message box tries to interpret what you are trying to execute,
but is not always able to do what you think it should.

try this:

New stack
stack script
function doDateConv dateStr
  get dateStr
  convert it to dateItems
  put (dateStr is a date) & cr & it into replyStr
  return replyStr
end doDateConv

centurycutoff for me is 35,
OSX 10.4.10   Rev 2.7.2

note the last entry
then in the msg box type:

put doDateConv("7/7/77")
 true
1977,7,7,2,0,0,5

put doDateConv("3/5/68")
true
1968,3,5,1,0,0,3

put doDateConv("5/31/42")
true
1942,5,31,2,0,0,1

put doDateConv("5/31/32")
true
2032,5,31,2,0,0,2

Hope this helps

Jim Ault
Las Vegas





More information about the use-livecode mailing list