Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!uflorida!gatech!mcnc!decwrl!ads.com!jtn From: jtn@ADS.COM (John T. Nelson) Newsgroups: comp.unix.questions Subject: How to generate Unix time from dates? Message-ID: <9X5%Q7*@ads.com> Date: 25 Oct 90 20:31:34 GMT Sender: usenet@ads.com (USENET News) Organization: Advanced Decision Systems, Mtn. View, CA (415) 960-7300 Lines: 24 For a project I'm working on I'd like to generate an unsigned long which contains the time of day on Unix systems. This amounts to usec in the Unix time.h time_val struct I think. Is there an algorithm for doing this? For example I would like to generate the time for Jan 1 1970 or Jan 1 1904. Does this algoirthm also take into acount leap years and LEAP SECONDS? Are there other wierdnesses to worry about? By the way, I know the epoch began in 1970 but there are reasons I would also like to generate time from 1904 and still state it in Unix time format in usec's. Please respond by mail since are news capability is down. Thanks. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ORGANIZATION: Advanced Decision Systems GEOGRAPHIC: Arlington, VA UUCP: kzin!speaker@mimsy.umd.edu INTERNET: jtn@potomac.ads.com