From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,f30b7a4226aca9b0 X-Google-Attributes: gidf7344,public X-Google-Thread: 1094ba,f30b7a4226aca9b0 X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,f30b7a4226aca9b0 X-Google-Attributes: gid1164f8,public From: Arne =?iso-8859-1?Q?Vajh=F8j?= Subject: Re: Date Calculations in Dec Fortran Date: 1999/03/01 Message-ID: <36DAA9B8.5CD1185E@gtech.com>#1/1 X-Deja-AN: 449977018 Content-Transfer-Encoding: 7bit References: <36DA2562.D3D02A6E@transtech.net> To: Daniel Steinmetz , avajhoej@gtech.com X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: GTECH Corporation News Server Mime-Version: 1.0 Newsgroups: comp.lang.fortran,comp.sys.dec,comp.os.vms Daniel Steinmetz wrote: > Does anyone have routines that manipulate dates and would not mind > sharing them ? I'm interested in subtracting a certain number of days > from todays date (format YYYYMMDD ) and getting the result in a similar > format. One solution is to use the C RTL like: integer*4 t2 structure /tm/ integer*4 tm_sec,tm_min,tm_hour,tm_mday,tm_mon,tm_year, + tm_wday,tm_yday,tm_isdst endstructure record /tm/t integer*4 decc$mktime,decc$localtime t.tm_year=99 t.tm_mon=2 t.tm_mday=1 t.tm_hour=0 t.tm_min=0 t.tm_sec=0 t2 = decc$mktime(t) t2 = t2 - 67*(24*60*60) call lib$movc3(9*4,%val(decc$localtime(t2)),t) write(*,*) t.tm_year,t.tm_mon,t.tm_mday end which surprisngly works fine on VMS Alpha 6.2 ! Arne