cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
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