<?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 Input a date time with construct &amp;lt;day-name&amp;gt; &amp;lt;month-name&amp;gt; &amp;lt;day&amp;gt; &amp;lt;hh:mm:ss&amp;gt; GMT &amp;lt;year&amp;gt; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-a-date-time-with-construct-lt-day-name-gt-lt-month-name-gt/m-p/965540#M375879</link>
    <description>&lt;P&gt;I'm dealing with an API that returns timestamps as strings such as "Wed Apr 30 13:44:54 GMT 2025"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANYDTDTM. informat does not properly parse the timestamp from the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The construct looks like it is from Java via&lt;/P&gt;
&lt;PRE&gt;DateTimeFormatter.ofPattern("E M d k:m:s 'GMT' y")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a SAS informat that directly reads the string?&lt;/P&gt;</description>
    <pubDate>Thu, 01 May 2025 17:39:02 GMT</pubDate>
    <dc:creator>RichardAD</dc:creator>
    <dc:date>2025-05-01T17:39:02Z</dc:date>
    <item>
      <title>Input a date time with construct &lt;day-name&gt; &lt;month-name&gt; &lt;day&gt; &lt;hh:mm:ss&gt; GMT &lt;year&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-a-date-time-with-construct-lt-day-name-gt-lt-month-name-gt/m-p/965540#M375879</link>
      <description>&lt;P&gt;I'm dealing with an API that returns timestamps as strings such as "Wed Apr 30 13:44:54 GMT 2025"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANYDTDTM. informat does not properly parse the timestamp from the string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The construct looks like it is from Java via&lt;/P&gt;
&lt;PRE&gt;DateTimeFormatter.ofPattern("E M d k:m:s 'GMT' y")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a SAS informat that directly reads the string?&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 17:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-a-date-time-with-construct-lt-day-name-gt-lt-month-name-gt/m-p/965540#M375879</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-05-01T17:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Input a date time with construct &lt;day-name&gt; &lt;month-name&gt; &lt;day&gt; &lt;hh:mm:ss&amp;gt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-a-date-time-with-construct-lt-day-name-gt-lt-month-name-gt/m-p/965547#M375884</link>
      <description>&lt;P&gt;First, I would say that you need to describe what you mean by "ANYDTDTM. informat does not properly parse the timestamp from the string.".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code:&lt;/P&gt;
&lt;PRE&gt;data junk;
   x= "Wed Apr 30 13:44:54 GMT 2025";
   y= input(x,anydtdtm32.);
   format y datetime20.;
run;&lt;/PRE&gt;
&lt;P&gt;yields a value of 30APR2025:13:44:54 for Y, which looks like the "time" was parsed correctly. Note that if you do not provide a width then the informat uses a default width of 19. Your value as shown is 28 characters long. So you need to provide a width at least of 28. There are some cases where the width specified may need to be a few characters longer than the value to work properly, I can't remember an exact value but remember at least a few cases where a width of 32 worked where the value was a bit less and exact width didn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean that the Timezone is not included and is what you need then you need to say so. &lt;/P&gt;
&lt;P&gt;There are a number of FORMATS that display Timezone offsets. look in the documentation of the various B8601 and E8601 formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2025 18:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-a-date-time-with-construct-lt-day-name-gt-lt-month-name-gt/m-p/965547#M375884</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-05-01T18:59:48Z</dc:date>
    </item>
  </channel>
</rss>

