<?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: Date time formatting in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867777#M342739</link>
    <description>&lt;P&gt;I am mapping a data set from one program to another. When exported from the first program, the dates are all formatted as mm/dd/yyyy. In order to import the data into the second program, the dates must be formatted as yyyy/mm/dd. I am currently able to set this format in SAS, but when I export the data to excel, the date formats change back to mm/dd/yyyy. Is there a way to keep them as yyyy/mm/dd when exported?&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2023 15:03:47 GMT</pubDate>
    <dc:creator>pengaentu</dc:creator>
    <dc:date>2023-04-03T15:03:47Z</dc:date>
    <item>
      <title>Date time formatting in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867361#M342559</link>
      <description>&lt;P&gt;I have a datetime variable that I am having trouble converting into SAS. my date time variable is in the format dd/mm/yy tttt. An example of this date time is 11/5/2021 1525 for November 5 at 15:25 military time. Does anyone know if there is a formatting way to input this information into sas?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 23:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867361#M342559</guid>
      <dc:creator>smoore3790</dc:creator>
      <dc:date>2023-03-30T23:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Date time formatting in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867362#M342560</link>
      <description>&lt;P&gt;Read it as a string (or two strings) and then covert them into date and time and/or datetime values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input  string1 :$10. string2 :$4. @1 longstr $30. ;
  date1=input(string1,mmddyy10.);
  date2=input(scan(longstr,1,' '),mmddyy10.);
  time1=input(string2,hhmmss4.);
  time2=input(scan(longstr,2,' '),hhmmss4.);
  dt1=dhms(date1,0,0,time1);
  dt2=dhms(input(scan(longstr,1,' '),mmddyy10.),0,0,input(scan(longstr,2,' '),hhmmss4.));
  format date: yymmdd10. time: tod5. dt: datetime19. ;
cards;
11/5/2021 1525 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Displaying dates in MDY order is going to confuse 50% of your audience.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 23:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867362#M342560</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-30T23:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Date time formatting in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867383#M342571</link>
      <description>&lt;P&gt;worked great, thanks for the help&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 06:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867383#M342571</guid>
      <dc:creator>smoore3790</dc:creator>
      <dc:date>2023-03-31T06:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date time formatting in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867777#M342739</link>
      <description>&lt;P&gt;I am mapping a data set from one program to another. When exported from the first program, the dates are all formatted as mm/dd/yyyy. In order to import the data into the second program, the dates must be formatted as yyyy/mm/dd. I am currently able to set this format in SAS, but when I export the data to excel, the date formats change back to mm/dd/yyyy. Is there a way to keep them as yyyy/mm/dd when exported?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 15:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867777#M342739</guid>
      <dc:creator>pengaentu</dc:creator>
      <dc:date>2023-04-03T15:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date time formatting in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867779#M342741</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441483"&gt;@pengaentu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am mapping a data set from one program to another. When exported from the first program, the dates are all formatted as mm/dd/yyyy. In order to import the data into the second program, the dates must be formatted as yyyy/mm/dd. I am currently able to set this format in SAS, but when I export the data to excel, the date formats change back to mm/dd/yyyy. Is there a way to keep them as yyyy/mm/dd when exported?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want Excel to display dates in a particular style you need to tell Excel that fact.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you export the data to an Excel file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the second program? Is it a SAS program?&amp;nbsp; Why use an Excel file?&amp;nbsp; Why not just write a CSV file instead?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 15:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-time-formatting-in-sas/m-p/867779#M342741</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-03T15:09:13Z</dc:date>
    </item>
  </channel>
</rss>

