X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Message-ID: <51078E0D.3040101@wmc.eu> Date: Tue, 29 Jan 2013 09:53:33 +0100 From: Marten Jan de Ruiter User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Fwd: Re: Intel FORTRAN time_and_date function returns UTC instead of local time X-Forwarded-Message-Id: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Taking cygwin out of the loop, time_ifort.exe behaves correctly in cmd. In another post to this thread, Tim Prince mentionse that ifort bypasses the cygwin dll entirely. If time_ifort.exe is independent of cygwin, I would expect identical behavior for cmd and cygwin bash. But in cmd, it works as intended, whereas in cygwin it doesn't. I am baffled. Thanks for your effort. Marten Jan -- 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