- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get date yesterday?
In your data table, you can create a new column for example "date yesterday".
dt=current data table();// Nouvelle colonne : date hier
dt << New Column( "date hier",
Numeric,
"Continuous",
Format( "Best", 12 ),
);
and then you can write this formula with the date you want to get.
// Modifier la formule de colonne : date hier
dt:date hier << Set Formula( Date MDY( 7, 25, 2023 ) );
output you get this:
This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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 )