--------------------------------- LDos V1(3) for AMOS1.3 and above. LDos is (C) Niklas Sjöberg 1992 --------------------------------- PART THREE - Date commands -------------------------- Please note! All Ldate* commands only work within the range 1 Jan 1978 to 31 Dec 2099! Ldate - Convert a datestamp to an ACSII-string. A$=Ldate(STAMP) where stamp is the number of days since 1 Jan 1978. A$ will be in the form of "YYMMDD". Fx. 780101 or 920325. If the datestamp is less than zero (below 1 Jan 1978) the string 780101 will be returned. Also, this routine will only generate valid dates upto 2099 (which should be enough?) Lstamp - Convert year,month and day into a datestamp S=LStamp(YEAR,MONTH,DAY) where S will be in the standard datestamp-form : number of days since 1 Jan 1978. If the date is before 1 Jan 1978, 1 Jan 1978 will still be returned. Fx. Print Ldate(LStamp(1991,10,23)) --> 911023 Lsys Stamp - Get the current system-datestamp. A=Lsys Stamp where A will contain a datestamp which can be used in conjunction with Ldate to print the current date. Lsys Time - Get the current system-time. A$=Lsys Time where A$ will be in the form "HHMMSS", hours, minutes, seconds. No extra ":","." or "-" is added so that you easily can process this string to the format you like. -- Lset File Date - Change the datestamp of a file or a directory -- TEST=Lset File Date("name",STAMP,MIN,TICKS) -- THIS FUNCTION REQUIRES Release 2 -- where -- TEST will be true (-1) if the call was successful. "name" is -- of course the (path and) name of the file OR directory that is -- to be changed. STAMP is a normal datestamp like the one returned -- by Lstamp (see above), MIN are the number of minutes that have -- passed since midnight. TICKS are the number of ticks that have -- passed during the last minute (1 tick is the same as a VBL = 1/50 -- sec). I didn't mind adding conversionroutines for MIN and TICKS -- since they are so easy to calculate. It is probably harder to -- convert a userspecified datestring to a format that my routine -- could convert. The datestamp, which are a bit harder, can be -- converted easily with Lstamp. -- Please note that many filesystems (like OFS and FFS) doesn't -- allow you to change the date of the root-directory (this date is -- used to separate disks with the same name) Example: If Lset File Date("t:temp",Lstamp(1992,7,25), 480,1850) Print "Date is now 92-07-25, 08:00:37" Else Print "Set date failed!" EndIf CONTINUED IN NEXT ARTICLE.