cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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