cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
chandankishor66
Level III

Subtracting number of hours from Date and time

HI,

 

I want to subtract 6 hrs in 05-07-2022 01:00  so final value should be  04-07-2022 19:00
Can you please suggest me how perform this calculation in JMP16.

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Subtracting number of hours from Date and time

Use the In Hours() function

Date = Informat( "05/07/2022 01:00:00", "m/d/y h:m:s" );
New Date = Date - In Hours( 6 );
Show( Format( New Date, "m/d/y h:m:s" ) );

Displays

Format(New Date, "m/d/y h:m:s") = "05/06/2022 7:00:00 PM";
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Subtracting number of hours from Date and time

Use the In Hours() function

Date = Informat( "05/07/2022 01:00:00", "m/d/y h:m:s" );
New Date = Date - In Hours( 6 );
Show( Format( New Date, "m/d/y h:m:s" ) );

Displays

Format(New Date, "m/d/y h:m:s") = "05/06/2022 7:00:00 PM";
Jim

Recommended Articles