home *** CD-ROM | disk | FTP | other *** search
- ;----------------------------------------------------------------------------
- ; Copyright(C) 1996, The AEGiS Corporation
- ;----------------------------------------------------------------------------
- ;
- ; FUNCTION UnixToDos()
- ;
- ; Convert a UNIX date (count of seconds since midnight 01/01/70) to a
- ; DOS date (Date & Time)
- ;
- ;----------------------------------------------------------------------------
- #lib
- Declare Procedure UnixToDos(unsigned DateVal, Var Date NewDate, Var Time NewTime)
-
- ;----------------------------------------------------------------------------
- ; UNIX Date&time -> DOSdate&time
- ;
- Procedure UnixToDos(unsigned DateVal, Var Date NewDate, Var Time NewTime)
- int tyear
- int tday
- int thour
- int tminute
- int tmonth
- unsigned tsecond
-
- tsecond = DateVal % 86400
- DateVal = DateVal / 86400
-
- tyear = (DateVal / 365)+2
-
- tday = DateVal % 365 - tyear/4
- inc tday
-
- NewDate = tday + (tyear+68) * 365 + 17
- NewTime = tsecond
- EndProc
-