- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
about cal datetime..
col1 : 2024-07-12 14:21:33
col2 : 333
cal_col3 : 2024-07-12 19:54:33
“How can I calculate the date and time in Col3 by adding the minutes specified in Col2 to the date and time in Col1 in JMP?
For example, if Col1 contains 2024-02-01 14:21:33 and Col2 contains 333, I want Col3 to show 2024-02-01 19:54:33
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
Hi,
You can use the "Date Increment" function to calculate what you need (see below)
Date Increment( :Col1, "Minute", :Col2)
Best,
TS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
Hi,
You can use the "Date Increment" function to calculate what you need (see below)
Date Increment( :Col1, "Minute", :Col2)
Best,
TS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
If your col1 is a character column and not a JMP numeric DateTime column you will need to use this formula for the calculation
Date Increment(
Informat( :col1,
"Format Pattern", "<YYYY><-><MM><-><DD><hh><:><mm><:><ss>" ),
"Minute",
:col2
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
Date Increment() which was suggested is the best option. Only thing you have to remember with that is to use alignment "actual" (it default to start) IF you care about the seconds. If you leave it as default (start), it will remove seconds. You can compare these two formulas
Date Increment( :Col1, "Minute", :Col2)
Date Increment( :Col1, "Minute", :Col2, "actual")
Other option is to add the minutes as seconds to your date (you can use In Minutes() to perform the conversion or multiply by 60)
:Col1 + In Minutes(:Col2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: about cal datetime..
And to fully complete the discussion, one can take the issue down to the basics and just multiply the number of seconds in a minute times the number of minutes to achieve the desired result.
:Col1 + :Col2 * 60