<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic bogus results from gmtime  in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/bogus-results-from-gmtime/m-p/745801#M3835</link>
    <description>I call gmtime to convert seconds since 1970 to the corresponding year, month, day, etc. It works under Windows, but when called under Linux, it gives incorrect results. For example, the year, which is supposed to be the year since 1900, is over 200,000. I tried calling it with seconds_since_1970 = 0, and it gave a set of seemingly random numbers, instead of the 1 Jan 1970 answer it should get. I'm surprised no one else is getting this error. Hard to imagine the code around it could be messing it up. I've seen some posts about multithreading issues, but this code is not multithreaded.&lt;BR /&gt;&lt;BR /&gt;Any help would be appreciated. In the mean time, I guess I'll code my own algorithm...&lt;BR /&gt;&lt;BR /&gt;Evan</description>
    <pubDate>Thu, 22 Apr 2010 18:47:52 GMT</pubDate>
    <dc:creator>evankw21</dc:creator>
    <dc:date>2010-04-22T18:47:52Z</dc:date>
    <item>
      <title>bogus results from gmtime</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/bogus-results-from-gmtime/m-p/745801#M3835</link>
      <description>I call gmtime to convert seconds since 1970 to the corresponding year, month, day, etc. It works under Windows, but when called under Linux, it gives incorrect results. For example, the year, which is supposed to be the year since 1900, is over 200,000. I tried calling it with seconds_since_1970 = 0, and it gave a set of seemingly random numbers, instead of the 1 Jan 1970 answer it should get. I'm surprised no one else is getting this error. Hard to imagine the code around it could be messing it up. I've seen some posts about multithreading issues, but this code is not multithreaded.&lt;BR /&gt;&lt;BR /&gt;Any help would be appreciated. In the mean time, I guess I'll code my own algorithm...&lt;BR /&gt;&lt;BR /&gt;Evan</description>
      <pubDate>Thu, 22 Apr 2010 18:47:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/bogus-results-from-gmtime/m-p/745801#M3835</guid>
      <dc:creator>evankw21</dc:creator>
      <dc:date>2010-04-22T18:47:52Z</dc:date>
    </item>
    <item>
      <title>bogus results from gmtime</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/bogus-results-from-gmtime/m-p/745802#M3836</link>
      <description>It seems to work for me, with a question about the daylight savings time, which I would expect to be "1" and not "0". Make sure you have USE IFPORT and IMPLICIT NONE in your code, such as I have below:&lt;BR /&gt;&lt;PRE&gt;[bash]program gmtim&lt;BR /&gt;use IFPORT&lt;BR /&gt;implicit none&lt;BR /&gt;&lt;BR /&gt;integer(4) stime, timearray(9)&lt;BR /&gt;&lt;BR /&gt;! initialize stime to number of seconds since&lt;BR /&gt;! 00:00:00 GMT January 1, 1970&lt;BR /&gt;&lt;BR /&gt;stime = time()&lt;BR /&gt;&lt;BR /&gt;CALL GMTIME (stime, timearray)&lt;BR /&gt;&lt;BR /&gt;print *, "seconds          ", timearray(1)&lt;BR /&gt;print*,  "minutes          ", timearray(2)&lt;BR /&gt;print*,  "hours            ", timearray(3)&lt;BR /&gt;print*,  "day in month     ", timearray(4)&lt;BR /&gt;print*,  "month            ", timearray(5)&lt;BR /&gt;print*,  "years since 1900 ", timearray(6)&lt;BR /&gt;print*,  "day of week      ", timearray(7)&lt;BR /&gt;print*,  "day of year      ", timearray(8)&lt;BR /&gt;print*,  "daylight savings?", timearray(9)&lt;BR /&gt;&lt;BR /&gt;end program gmtim&lt;BR /&gt;[/bash]&lt;/PRE&gt; &lt;BR /&gt;&lt;BR /&gt;and the results&lt;BR /&gt;&lt;BR /&gt;$ date ; ./gmtim&lt;BR /&gt;Thu Apr 22 13:54:11 PDT 2010&lt;BR /&gt;seconds 11&lt;BR /&gt;minutes 54&lt;BR /&gt;hours 20&lt;BR /&gt;day in month 22&lt;BR /&gt;month 3&lt;BR /&gt;years since 1900 110&lt;BR /&gt;day of week 4&lt;BR /&gt;day of year 111&lt;BR /&gt;daylight savings? 0&lt;BR /&gt;&lt;BR /&gt;Note that month is zero-based, months 0-11, so one could add 1 to this. I'm using PDT, GMT - 8 so I'd have to subract 8 from GMT returned AND the results give 0 for Daylight, add 1.&lt;BR /&gt;&lt;BR /&gt;Other than that, works fine for me.&lt;BR /&gt;&lt;BR /&gt;ron</description>
      <pubDate>Thu, 22 Apr 2010 20:59:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/bogus-results-from-gmtime/m-p/745802#M3836</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2010-04-22T20:59:44Z</dc:date>
    </item>
  </channel>
</rss>

