Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: Decoding a DateStamp Message-ID: <8805080513.AA26532@cory.Berkeley.EDU> Date: 8 May 88 05:13:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 28 :Is there a routine tucked away in one of the libraries that'll convert :a struct DateStamp to something more people-palatable. Just converting it :to a suitable string would be OK, but actually getting an array with :year, month, day, hour, minute separated would be neat. I've been looking :through the kernel documentation I have and I can't find anything that does :that (or goes the other way: takes a string or array describing a date and :packs it into a struct DateStamp). Thanks. No. Not in any of the system libraries. However, routines to do this type of conversion do exist in the C libraries for Aztec and Lattice. The way DateStamp() is setup: [0] = # of days since (when?) [1] = # minutes that occured so far this day [2] = # of ticks elapsed in the current minute. It is quite easy to determine an ascii time stamp from the first argument. Not including daylight savings, you only have to worry about leap years: -A leap year occurs every four years (mod 4), except three out of every four century marks (mod 100) are NOT leap years. The one that is is (mod 400). Good luck, -Matt