delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE |
X-Spam-Check-By: | sourceware.org |
X-Received: | by 10.152.105.38 with SMTP id gj6mr1385034lab.25.1359024441378; Thu, 24 Jan 2013 02:47:21 -0800 (PST) |
Message-ID: | <51011134.5030209@gmail.com> |
Date: | Thu, 24 Jan 2013 11:47:16 +0100 |
From: | marco atzeri <marco DOT atzeri AT gmail DOT com> |
User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Intel FORTRAN time_and_date function returns UTC instead of local time |
References: | <DUB117-W6214C06B8452D8B91EE297A7140 AT phx DOT gbl> |
In-Reply-To: | <DUB117-W6214C06B8452D8B91EE297A7140@phx.gbl> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On 1/24/2013 11:01 AM, Marten Jan de Ruiter wrote: > > I wrote a FORTRAN program using the time_and_date function. The source follows below. The time_and_date function returns the wrong time: I am not in UTC, so czone should be +0100. > > In the following output, the lines "ctime:..." to "milliseconds..." are based on time_and_date. The line 15:54:49 is the correct time obtained by the time function, and the line 23-JAN-13 is the correct date obtained by the date function. > > ctime: 20130123 > cdate: 145449.947 > czone: -0000 > @ 2013-01-23 14:54:49.947 > year 2013 > month 1 > day 23 > diff wrt UTC 0 minutes > hours 14 > minutes 54 > seconds 49 > milliseconds 947 > > 15:54:49 > 23-JAN-13 > > > I have done some experiments to narrow down the problem: > * compiling with gfortran: time_gfortran.exe gives correct result in Cygwin > * compiling with g95: time_g95.exe gives the correct result in Cygwin these two compilers are cygwin ones > * compiling with ifort: time_ifort.exe gives the wrong time in Cygwin this is not. Take cygwin out of the loop, what is the answer of time_ifort.exe in cmd ? > > After copying cygwin1.dll, cyggfortran-3.dll and cyggcc_s-1.dll to the working directory, I get correct results > using the three executables in c:\windows\system32\cmd.exe. > > I suspect that the intel compiler does a different system call for time_and_date than for date and time, that the system call is intercepted by Cygwin, and not properly handled. I am still baffled why the same source runs fine for gfortran and g95. Notice however that for these compilers, the _date_ and _time_ functions are not defined. Hence the preprocessor exclusion in the source. I doubt cygwin is intercepting a not cygwin program call to MS ssystem -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |