Choose Language Hide Translation Bar
Onjai
Community Trekker

Column formula to round timestamp to nearest minute

Hi,

Looking for a column formula to round timestamp to nearest minute. 

27/06/2017 12:21:13 PM  need to round to 27/06/2017 12:21:00 PM.

Any suggestions?

Cheers.

0 Kudos
2 ACCEPTED SOLUTIONS

Accepted Solutions
julian
Staff

Re: Column formula to round timestamp to nearest minute

Hi @Onjai,

I'm sure there are other ways to approach this, but I've had luck with the following when I've needed to do that (this requires that you have a numeric :DateTime column):

 

Round(:DateTime / 60) * 60

(Edited: replaced with the simpler formula pointed out by Jerry)

 

Hope this helps!

@julian

 

 

View solution in original post

Highlighted
Onjai
Community Trekker

Re: Column formula to round timestamp to nearest minute

I am using the latest version of JMP.  The transform worked as well.

Thank you!

View solution in original post

0 Kudos
5 REPLIES 5
julian
Staff

Re: Column formula to round timestamp to nearest minute

Hi @Onjai,

I'm sure there are other ways to approach this, but I've had luck with the following when I've needed to do that (this requires that you have a numeric :DateTime column):

 

Round(:DateTime / 60) * 60

(Edited: replaced with the simpler formula pointed out by Jerry)

 

Hope this helps!

@julian

 

 

View solution in original post

Onjai
Community Trekker

Re: Column formula to round timestamp to nearest minute

Julian,

This worked just fine.

Thank you.

 

0 Kudos
jerry_cooper
Staff (Retired)

Re: Column formula to round timestamp to nearest minute

Hi Onjai,
If you're using version 14, you can right-click the heading of your Timestamp column, select New Formula Column->Transform->Round. You'll then get a dialog box to set the desired parameters (because you're wanting to round to the nearest minute, you'll just need to select "Nearest" from the dropdown and click OK). This is the resulting formula:
Round(:Timestamp / 60) * 60
Highlighted
Onjai
Community Trekker

Re: Column formula to round timestamp to nearest minute

I am using the latest version of JMP.  The transform worked as well.

Thank you!

View solution in original post

0 Kudos

Re: Column formula to round timestamp to nearest minute

:Time Stamp - Modulo( :Time Stamp, 60 );
Learn it once, use it forever!