<?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: How to export time to excel ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620046#M182130</link>
    <description>&lt;P&gt;One option is convert your datetime/time value into the character representation. Take the below as an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time :datetime.;
format time datetime.;
datalines;
01JAN2020:05:33:00
;
run;

data want;
set have;
new_time = put(timepart(time),tod5.);
drop time;
run;

proc export data=want 
	file='/folders/myfolders/test.xlsb' 
	dbms=xls
	replace;
	sheet="test";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2020-01-25 22-00-47.png" style="width: 146px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35624i06B5B2327D09C24F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2020-01-25 22-00-47.png" alt="Screenshot from 2020-01-25 22-00-47.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jan 2020 05:01:18 GMT</pubDate>
    <dc:creator>unison</dc:creator>
    <dc:date>2020-01-26T05:01:18Z</dc:date>
    <item>
      <title>How to export time to excel ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620043#M182127</link>
      <description>Hi I have table with start time. hh:mm when I export to excel using proc ecport to a xlsb file lt adds generic date and the correct time thanks for assistance for example 01/01/1990 05:33</description>
      <pubDate>Sun, 26 Jan 2020 04:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620043#M182127</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2020-01-26T04:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to export time to excel ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620046#M182130</link>
      <description>&lt;P&gt;One option is convert your datetime/time value into the character representation. Take the below as an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input time :datetime.;
format time datetime.;
datalines;
01JAN2020:05:33:00
;
run;

data want;
set have;
new_time = put(timepart(time),tod5.);
drop time;
run;

proc export data=want 
	file='/folders/myfolders/test.xlsb' 
	dbms=xls
	replace;
	sheet="test";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2020-01-25 22-00-47.png" style="width: 146px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35624i06B5B2327D09C24F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2020-01-25 22-00-47.png" alt="Screenshot from 2020-01-25 22-00-47.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 05:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620046#M182130</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-26T05:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to export time to excel ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620050#M182133</link>
      <description>Thanks will try it</description>
      <pubDate>Sun, 26 Jan 2020 06:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620050#M182133</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2020-01-26T06:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to export time to excel ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620052#M182134</link>
      <description>&lt;P&gt;Excel does not have a time of day concept like SAS.&amp;nbsp; So when you enter a time in excel it always stores it as that time&amp;nbsp; of day on some day.&amp;nbsp; You can change the display format in Excel to have it just show the time part however.&lt;/P&gt;
&lt;P&gt;When opened excel and typed in 12:00 it stored 0.5 and set the display to show it as hours and minutes.&amp;nbsp; But if you change the display format you can get it to show the year, month and day also.&amp;nbsp; (And also discover why you shouldn't use Excel to store dates before March 1, 1900.)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 556px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35625iC18984806342DDC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 06:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620052#M182134</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-26T06:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to export time to excel ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620267#M182226</link>
      <description>Thank you it works</description>
      <pubDate>Mon, 27 Jan 2020 18:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-time-to-excel/m-p/620267#M182226</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2020-01-27T18:16:17Z</dc:date>
    </item>
  </channel>
</rss>

