I often need to bin each row based on the date time. However, this is kind of troublesome for the data time. let say I am binning based before 7/22/2020 12:00:00pm as Good and after as bad. I can use the IF formula logic to compare the date time to 7/22/2020 12:00:00pm. But to do that I need to convert to the numeric value of 3678264000. if there any quicker way to do this? thanks
what you need to use is the Informat() function
if( :date < informat("01/22/2020","m/d/y" ), "Good", "Bad");
Hi,
Have you considered the "Informat" function, such as used below:
If( :Column 1 < Informat( "07/21/2020 12:00 PM", "MM/dd/yyyy hr:min" ),
1,
0
)Best,
TS
many thanks both. The informat works perfectly. :)
You can use a date literal in JSL or the formula editor. You just need to use the ddMONyyyy format.
date=22Jul2020;
tomorrow=22Jul2020+in days(1);
show(date, tomorrow, format(tomorrow, "mm/dd/yyyy"));
in the log you get:
date = 22Jul2020; tomorrow = 3678307200; Format(tomorrow, "mm/dd/yyyy") = "07/23/2020";
Read more: Using dates, times, datetimes and durations in JMP