cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
Mawkish
Level I

Timestamp question

Hello,

I am challenged by the removal of a timestamp in a cell. See example. 01/07/2025 12:00:00 AM

I want to remove the 12:00:00 AM and achieve this  01/07/2022.

Thank you in advance for your assistance.

3 REPLIES 3
txnelson
Super User

Re: Timestamp question

All you need to do is to change the display format for your column.

JMP date/time values are a numeric value of the number of seconds since 12 AM Jan 1, 1904.  

Therefore, JMP's numeric value for 01/07/2025 12:00:00 AM is the same as the numeric value of 01/07/2025

withTime = informat("01/07/2025 12:00:00 AM","m/d/y h:m:s");
show(format(withTime,"fixed dec",12,2));
onlyDate = informat("01/07/2025","m/d/y");
show(format(onlyDate,"fixed dec",12,2));
Format(withTime, "fixed dec", 12, 2) = "3819052800.0";
Format(onlyDate, "fixed dec", 12, 2) = "3819052800.0";

Just change the format of the column to m/d/y and you will have what you want.

Jim
Ressel
Level VII

Re: Timestamp question

In addition to the response already given, it is possible to remove the time of day; in your case 12:00:00; from a date using JSL:

:Date - Time Of Day( :Date )

All that remains to do is the changing of the column format:

Ressel_0-1751438734764.png

See also the example attached.

 

jthi
Super User

Re: Timestamp question

And in more general remove the date of time from the timestamp. If we assume you have correctly formatted data in column called TIMESTAMP, you can use quick formula from right click menu

jthi_0-1751438792613.png

And it will give you the formula you would use

:TIMESTAMP - Time Of Day(:TIMESTAMP)

jthi_1-1751438831771.png

You can verify that values have changed by changing the format to Best

jthi_2-1751438870554.png

 

-Jarmo

Recommended Articles