<?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 Re: adjust datetime variable with GMT offset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482152#M124831</link>
    <description>&lt;P&gt;Thanks. I worked it out this way too. Just a quick question. How can I get millisecond from a time variable ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Jul 2018 04:36:46 GMT</pubDate>
    <dc:creator>somebody</dc:creator>
    <dc:date>2018-07-28T04:36:46Z</dc:date>
    <item>
      <title>adjust datetime variable with GMT offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482083#M124810</link>
      <description>&lt;P&gt;I have a date_time variable that is in&amp;nbsp;B8601DZ35. format which I successfully separated to a date variable and a time variable. I have another variable that contains the GMT offset. I would like to adjust my date_time variable for this GMT offset.How would I go about this?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Date-Time	                GMT Offset
2017-01-11T14:30:04.365434911Z  -5
2017-01-11T14:30:26.597592398Z	-5
2017-01-11T14:44:08.071375241Z	-5
2017-01-11T17:26:08.197434809Z	-5
2017-01-11T13:00:05.983270062Z	-5
2017-01-11T13:51:43.118027494Z	-5
2017-01-11T14:30:04.346793673Z	-5
2017-01-11T14:50:36.791404253Z	-5
2017-01-11T14:50:46.555107131Z	-5
2017-01-11T15:05:32.194165072Z	-5
2017-01-11T15:05:32.258194133Z	-5
2017-01-11T15:05:32.258194133Z	-5
2017-01-11T15:05:32.258194133Z	-5
2017-01-11T15:05:48.638213623Z	-5
2017-01-11T15:05:49.242262429Z	-5
2017-01-11T15:05:49.242262429Z	-5
2017-01-11T15:05:52.334463850Z	-5
2017-01-11T15:05:52.718504205Z	-5&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;here is an example of the data. Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 22:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482083#M124810</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2018-07-27T22:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: adjust datetime variable with GMT offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482099#M124812</link>
      <description>&lt;P&gt;As long as you have a datetime variable in a dt SAS format, you should be able to use the intnx function to shift the stamp by the value in GMT_Offset:&lt;BR /&gt;&lt;BR /&gt;new_dt=intnx('hour',date_time,GMT_Offset,'s')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I typed intck and meant intnx - duh.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 22:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482099#M124812</guid>
      <dc:creator>bobpep212</dc:creator>
      <dc:date>2018-07-27T22:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: adjust datetime variable with GMT offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482152#M124831</link>
      <description>&lt;P&gt;Thanks. I worked it out this way too. Just a quick question. How can I get millisecond from a time variable ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jul 2018 04:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482152#M124831</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2018-07-28T04:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: adjust datetime variable with GMT offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482523#M125012</link>
      <description>&lt;P&gt;You can get the decimal portion of seconds&amp;nbsp;of a datetime in a data step as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;decimal = datetime - floor(datetime);&lt;/P&gt;
&lt;P&gt;since datetimes are stored as seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on which part of the value you want and how you want it multiplication, division and or round, floor or ceil functions may come into play.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 16:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adjust-datetime-variable-with-GMT-offset/m-p/482523#M125012</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-30T16:05:26Z</dc:date>
    </item>
  </channel>
</rss>

