<?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: today's date and time are showing 01jan1960 in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734207#M1706</link>
    <description>&lt;P&gt;Use format&amp;nbsp;&lt;FONT face="courier new,courier"&gt;date.&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;datetime.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Apr 2021 12:20:18 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-04-15T12:20:18Z</dc:date>
    <item>
      <title>today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734205#M1705</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am doing below for today's time and date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dt1= %sysfunc(putn(%eval(%sysfunc(today())-1),datetime.));&lt;/P&gt;&lt;P&gt;%put &amp;amp;dt1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is showing below date -&amp;nbsp;01JAN60:06:13:04&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i get current TIME that also with leading zero in case it is single digit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 12:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734205#M1705</guid>
      <dc:creator>RDS2020</dc:creator>
      <dc:date>2021-04-15T12:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734207#M1706</link>
      <description>&lt;P&gt;Use format&amp;nbsp;&lt;FONT face="courier new,courier"&gt;date.&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;datetime.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 12:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734207#M1706</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-15T12:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734208#M1707</link>
      <description>&lt;P&gt;Dates are counts of days, while times and datetimes are counts of seconds. With 1960-01-01T00:00:00 as the zero point, today's date value (22385) will show up as a datetime sometime on 1960-01-01.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How you format the value (or not) depends on the further use. If you do not need it for display, the raw value is best, as you can then use the macro variable without further ado:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dt1=%sysevalf(%sysfunc(datetime())-86400);

%put &amp;amp;=dt1.;

data want;
set have;
if datetimevalue le &amp;amp;dt1.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With DATETIME(), you will get time down to microseconds, so you need to use %SYSEVALF to cope with the fraction.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 12:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734208#M1707</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-15T12:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734268#M1708</link>
      <description>&lt;P&gt;TODAY() is just an alias for DATE() which returns a date value (number of days) not a datetime value (number of seconds).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the current datetime value use DATETIME() function instead of DATE() function.&amp;nbsp; To have the string formatted properly use at least a width of 19 in the format specification, otherwise you will get only two digits for the year.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dt1= %sysfunc(intnx(dtday,%sysfunc(datetime()),-1,s),datetime19.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To get the current time of day (seconds since midnight) use the TIME() function.&amp;nbsp; To format it with leading zeros use the TOD format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 13:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734268#M1708</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-15T13:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734601#M1709</link>
      <description>&lt;P&gt;Thanks for replying. What about the Time part of it . I would need time part with leading zero if its single digit&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 22:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734601#M1709</guid>
      <dc:creator>RDS2020</dc:creator>
      <dc:date>2021-04-15T22:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: today's date and time are showing 01jan1960</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734611#M1710</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dt1= %sysfunc(putn(%eval(%sysfunc(today())-1),datetime.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is no time associated with &lt;FONT face="courier new,courier"&gt;today()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, trivially, the time associated with &lt;FONT face="courier new,courier"&gt;today()&lt;/FONT&gt; is 00:00:00.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what do you want from &lt;FONT face="courier new,courier"&gt;today()&lt;/FONT&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 23:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/today-s-date-and-time-are-showing-01jan1960/m-p/734611#M1710</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-15T23:28:15Z</dc:date>
    </item>
  </channel>
</rss>

