DATA Step, Macro, Functions and more

Date() vs Today ()

Reply
Occasional Contributor
Posts: 7

Date() vs Today ()

Hi,

 

Please help me understand the difference between date () and today () function.

Are they always the same ?

 

 

Thanks !

 

 

 

PROC Star
Posts: 1,805

Re: Date() vs Today ()

Posted in reply to HarshaChaube

My test gives me same results

 

data w;
date1=today();
output;
put date1= ;
date1=date();
output;
put date1= ;
format date1 date9.;
run;


date1=03JUL2018
date1=03JUL2018

Occasional Contributor
Posts: 7

Re: Date() vs Today ()

Posted in reply to novinosrin

yes, exactly. I get the same results.

But is there any scenario where they differs?

PROC Star
Posts: 1,805

Re: Date() vs Today ()

Posted in reply to HarshaChaube

No idea. Both of us will have to wait for responses from somebody who knows about it.

Super User
Posts: 23,724

Re: Date() vs Today ()

Posted in reply to HarshaChaube
Super User
Super User
Posts: 8,111

Re: Date() vs Today ()

Posted in reply to HarshaChaube

The same difference as between right Twix and a left Twix.

Super User
Super User
Posts: 9,599

Re: Date() vs Today ()

The left finger, as with the right finger are both Unixes, its only when join in one packet do they become a Twix.  Being right handed, means right is always first and thus better.

Ask a Question
Discussion stats
  • 6 replies
  • 189 views
  • 8 likes
  • 5 in conversation