cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
UserID16644
Level V

How to get date yesterday?

I would want to get the date yesterday, I am using the today () function

dateNow = Format (Today(), "m/d/y");

However, I don't know how to derive from dateNow the date yesterday. Tried using d = (dateNow - 1);

but is not working.

2 REPLIES 2
hcarr01
Level VI

Re: How to get date yesterday?

Dans ta table de données, tu peux créer une nouvelle colonne par exemple « date hier ».

 

dt=current data table();

// Nouvelle colonne : date hier dt << New Column( "date hier", Numeric, "Continuous", Format( "Best", 12 ), );

et ensuite tu peux écrire cette formule avec la date que tu souhaites obtenir.

 

// Modifier la formule de colonne : date hier
dt:date hier << Set Formula( Date MDY( 7, 25, 2023 ) );

en sortie tu obtiens ceci :

 

hcarr01_0-1690358964494.png

 

jthi
Super User

Re: How to get date yesterday?

You will have to deduct the seconds in one day from Today(), using In Days(1) is one option (you could also use 24*60*60)

Today() - In Days(1)

Datetime values are handled internally as numbers of seconds since midnight, January 1, 1904 (JSL Syntax Reference > JSL Functions, Operators, and Messages > Date and Time Functions )

-Jarmo

Recommended Articles