cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

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