<?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 UTC time format script output different in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150578#M671306</link>
    <description>I have a script that sources from dual.&lt;BR /&gt;SELECT TO_CHAR(CURRENT_DATE,'DD-MON-YY-HH24:MI:SS')&lt;BR /&gt;FROM dual&lt;BR /&gt;&lt;BR /&gt;If I run this from command line I get the time in UTC, just like the rest of the time stamps for the script...&lt;BR /&gt;IE:&lt;BR /&gt;SELECT TO_CHAR(capture_message_create_time,'DD-MON-YY-HH24:MI:SS')&lt;BR /&gt;FROM v\$streams_capture&lt;BR /&gt;&lt;BR /&gt;So the output would look like:&lt;BR /&gt;14-JAN-09-16:00:00   14-JAN-09-15:59:58 &lt;BR /&gt;&lt;BR /&gt;But if I run from cron...&lt;BR /&gt;Out put is:&lt;BR /&gt;14-JAN-09-10:00:00   14-JAN-09-15:59:58 &lt;BR /&gt;&lt;BR /&gt;Which is 6 hours out.&lt;BR /&gt;I source my environment in my script and TZ=UTC.&lt;BR /&gt;&lt;BR /&gt;So why the difference, and how do I make it all the same?&lt;BR /&gt;&lt;BR /&gt;I would like it all in either UTC, or all -6 CST</description>
    <pubDate>Wed, 14 Jan 2009 16:52:02 GMT</pubDate>
    <dc:creator>Ratzie</dc:creator>
    <dc:date>2009-01-14T16:52:02Z</dc:date>
    <item>
      <title>UTC time format script output different</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150578#M671306</link>
      <description>I have a script that sources from dual.&lt;BR /&gt;SELECT TO_CHAR(CURRENT_DATE,'DD-MON-YY-HH24:MI:SS')&lt;BR /&gt;FROM dual&lt;BR /&gt;&lt;BR /&gt;If I run this from command line I get the time in UTC, just like the rest of the time stamps for the script...&lt;BR /&gt;IE:&lt;BR /&gt;SELECT TO_CHAR(capture_message_create_time,'DD-MON-YY-HH24:MI:SS')&lt;BR /&gt;FROM v\$streams_capture&lt;BR /&gt;&lt;BR /&gt;So the output would look like:&lt;BR /&gt;14-JAN-09-16:00:00   14-JAN-09-15:59:58 &lt;BR /&gt;&lt;BR /&gt;But if I run from cron...&lt;BR /&gt;Out put is:&lt;BR /&gt;14-JAN-09-10:00:00   14-JAN-09-15:59:58 &lt;BR /&gt;&lt;BR /&gt;Which is 6 hours out.&lt;BR /&gt;I source my environment in my script and TZ=UTC.&lt;BR /&gt;&lt;BR /&gt;So why the difference, and how do I make it all the same?&lt;BR /&gt;&lt;BR /&gt;I would like it all in either UTC, or all -6 CST</description>
      <pubDate>Wed, 14 Jan 2009 16:52:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150578#M671306</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-01-14T16:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: UTC time format script output different</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150579#M671307</link>
      <description>The cron environment is different than that of the command line. When you run the same script from cron you have to set the user environment just like it is in the command line. I am guessing this is a database account (oracle?) so when you run this script from cron you need to initialize all the variables as they are when you login to this account on the command line. If this is indeed an oracle account you need all the oracle parameters such as ORACLE_HOME, SID, TNS etc. When you are on the unix shell  command line type in the "env" command and see all the variables that have been set. Most of these are NOT setup when running in cron.</description>
      <pubDate>Wed, 14 Jan 2009 18:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150579#M671307</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-01-14T18:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: UTC time format script output different</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150580#M671308</link>
      <description>Thought I did, but didn't...&lt;BR /&gt;Had to add TZ=UTC in my script.</description>
      <pubDate>Wed, 14 Jan 2009 20:23:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/utc-time-format-script-output-different/m-p/5150580#M671308</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-01-14T20:23:27Z</dc:date>
    </item>
  </channel>
</rss>

