Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- difference between times

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 10, 2011 11:34 AM
(2890 views)

I have multiple columns of date/time data in YYYY-MM-DD HH:MM:SS format. I would like to calculate the difference in time, e.g. in minutes, between two of the columns. Does anyone have a quick way to do this? I've tried a few things with no luck. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Thanks. I figured it out. One of my problems was the seconds actually also had tenths of seconds and couldn't be interpreted in a standard numeric format. So what I ended up doing was using "munger" to remove those tenths (while it was still a character field), then using "num" to convert it to numeric data, then formating it as continuous datetime data, and then doing the subtraction. Not sure if that's the easiest way but it worked!

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: difference between times

Are the columns already being interpreted by JMP as numeric continuous datetimes? If so, you can just subtract the two, and it will give you the result in seconds. Then you can just divide to get min,hour, etc..

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: difference between times

Try the formula

where :Time1 and :Time2 are the two date/time columns. Time in JMP is represented by the number of seconds since a reference date and hence dividing by 60 gives the difference in minutes.

The Chadd was faster...

Message was edited by: MS

(:Time2 - :Time1) / 60

where :Time1 and :Time2 are the two date/time columns. Time in JMP is represented by the number of seconds since a reference date and hence dividing by 60 gives the difference in minutes.

The Chadd was faster...

Message was edited by: MS

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content