[comp.sys.mac.hypercard] Problems with time!

bskendig@phoenix.Princeton.EDU (Brian Kendig) (05/19/89)

My biggest problem with time is that I haven't enough of it to go around.
But I'll post *that* concern to another board...

I'm trying to figure out what day of the year it is in a HyperCard stack.
(Actually, I'm modifying Almanac 1.52 so it can work with my system, but
more about that later.)

Here's how I'm trying to go about it:
- I convert the last day of last year to seconds.
- I convert today to seconds.
- I subtract the two, giving me the number of seconds since the beginning of
     the year.

From there it's easy to determine the number of days since January 1.

Here's what I've narrowed the problem down to:
(The stuff the computer gives me when I issue commands from the message box
are indented.)

the date
	1989-5-18                    <- I modified my System date resources.
convert "1988-12-31" to seconds
it
	886464000
convert "1989-5-18" to seconds
it
	1357084800

Now, if you were paying attention, you'll notice that there are an alleged
470,620,800 seconds between 31 December 1988 and 18 March 1989.  That works
out to be 5,447 days.  Considering that there are only 365 days in an average
year, I'd say something is pretty messed up here.

I highly suspect that the problem lies in the fact that I redefined my
international resources in the System file.  The date is usually shown as
5/18/1989 (I think), but for my purposes it is more easily used if it is
shown in Canadian format, 1989-5-18.  (The latest version of ResEdit is *great*
for customizing international resources!)

But shouldn't HyperCard be intelligent to figure these things out for itself?
If it always assumes that the date will be in American form, what do the poor
Mounties do?

On a similar note, where can I get foreign HyperCard interpreters, or how
can I construct one of my own?  (I always thought that it would be nice to
write code in Esperanto...)

Thank you for your support.


-- 
| Brian S. Kendig         /\ +----+ /\ of Power | bskendig                   |
| Computer Engineering   / Triforces! \ Courage | @phoenix.Princeton.EDU     |
| Princeton University  +----+ \/ +----+ Wisdom | @PUCC.BITNET               |
| "Estu la Forteco kun vi."  - Obi-Wan Kenobi   | @somewhere_past_Betelgeuse |