SUBROUTINE CF.CONVERT.UNIX.DATESTAMP(conversion,pick.date,pick.time,unix.datestamp,result.code) * * Convert between *IX standard long-word date/time and Pick date/time variables * * conversion: 1 = convert to Pick * 2 = convert from Pick * * pick.date, pick.time, unix.datestamp - self explanatory * * result.code: 0 = no error * 1 = invalid conversion request * 2 = insufficient input values * 3 = invalid input values * * ======================================================================== * * Conditions of use: * This source code is the property and copyright of Gulraj Rijhwani and * Courtfields Limited. Specific licence is granted to copy and use this * program source, in accordance with the terms and conditions laid out * following. For the purposes of these terms and conditions the term * "developer" is defined to be the individual or company employing the * author incorporating use of this source. Any use of this source code is * deemed to be full and unreserved acceptance of these stated terms. * * 1) All instances of this source code must carry all attached * annotations and comments including, but not limited to, these * these conditions of use in their entirety. * 2) The developer may not alter the program source in any way, without * first obtaining the express written consent of duly authorised * company officers of Courtfields Limited, or its successors. * 3) This source code may not be included in whole or in part in any * proprietary program suite except as a separately compiled module * in wholly unmodified form. Any installed object code must be * accompanied by the original source code at all times. * 4) In the event of any breach of these terms and conditions the * developer shall be liable for an annual usage charge of 200 pounds * sterling for every end user terminal or session using or having * access to use the resulting executable code. * 5) Gulraj Rijhwani and Courtfields Limited make no warranties for * the fitness of this source code, and may not be held liable * for any failure to fulfil the expectations or requirements of * the developer. * * ======================================================================== * result.code = 0 * BEGIN CASE CASE conversion=0 GOSUB 1000 CASE conversion=1 GOSUB 2000 CASE 1 result.code = 1 END CASE * RETURN * 1000 * * pick.date = '' pick.time = '' IF unix.datestamp='' THEN result.code = 2 END ELSE IF OCONV(unix.datestamp,'MCN')=unix.datestamp THEN pick.date = INT(unix.datestamp/86400) pick.time = unix.datestamp - 86400 * pick.date pick.date = pick.date + 732 END ELSE result.code = 3 END END * RETURN * 2000 * * IF pick.date='' OR pick.time='' THEN result.code = 2 END ELSE IF OCONV(pick.date:pick.time,'MCN')=pick.date:pick.time THEN unix.datestamp = (pick.date - 732) * 86400 + pick.time END ELSE result.code = 3 END END * RETURN