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
WHG
WHG
Level I

How do I convert a timestamp to a duration format?

I would like to convert a column containing timestamp data in the numeric "ddMonyyyy h:m:s" time format to a numeric time duration format in seconds, starting the duration in the first row of my datatable.

1 REPLY 1
ron_horne
Super User (Alumni)

Re: How do I convert a timestamp to a duration format?

Hi @WHG 

try the following script

otherwise you can do it manually using the same functions

names default to here (1);
dt = current data table ();
dt << New Column( "Duration",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula(
			Date Difference(
				:Date of Observation[1],
				:Date of Observation,
				"second"
			)
		)
	);

let us know if it works

Recommended Articles