cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

date format

hcarr01
Level VI

Good morning,

I have a DB with two columns: input and output.
These columns are dates but are in the wrong format.

undefined


For example cell 14.45 corresponds to 2:45 p.m.

 

I tried by modifying the format of the column by saying that in input it was numeric format and in output I would like “h:m” as below:

 

undefined

 

This doesn't work, do you have any idea to solve this problem please?

Thank you for your answers !

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

2 ACCEPTED SOLUTIONS

Accepted Solutions


Re: format date

The issue is that time in JMP is categorized as seconds. 14.45 is not in seconds, so you need to convert your numbers into seconds.

There is likely a more economical way to do this formula, but this one shows exactly what is going on.

Dan_Obermiller_0-1694704306809.png

 

The first part (before the + sign) takes the integer portion and converts to seconds. The second part will find the fraction of the entry, multiply by 100 to convert to an integer, divide by 60 to convert to a fraction of an hour. Then, the "In Hours" function will convert that to seconds.

Dan Obermiller

View solution in original post

txnelson
Super User


Re: format date

To add to @Dan_Obermiller response, the below script will make the changes-in-place for the entrée column;

Names Default To Here( 1 );
dt = Current Data Table();

For Each Row(
	:entrée = In Hours( Floor( :entrée ) )
	+In Hours(
		Modulo( :entrée, Floor( :entrée ) ) * (100
		 / 60)
	)
);
:entrée << Format( "h:m" );

txnelson_0-1694713320569.png

 

Jim

View solution in original post

3 REPLIES 3


Re: format date

The issue is that time in JMP is categorized as seconds. 14.45 is not in seconds, so you need to convert your numbers into seconds.

There is likely a more economical way to do this formula, but this one shows exactly what is going on.

Dan_Obermiller_0-1694704306809.png

 

The first part (before the + sign) takes the integer portion and converts to seconds. The second part will find the fraction of the entry, multiply by 100 to convert to an integer, divide by 60 to convert to a fraction of an hour. Then, the "In Hours" function will convert that to seconds.

Dan Obermiller
txnelson
Super User


Re: format date

To add to @Dan_Obermiller response, the below script will make the changes-in-place for the entrée column;

Names Default To Here( 1 );
dt = Current Data Table();

For Each Row(
	:entrée = In Hours( Floor( :entrée ) )
	+In Hours(
		Modulo( :entrée, Floor( :entrée ) ) * (100
		 / 60)
	)
);
:entrée << Format( "h:m" );

txnelson_0-1694713320569.png

 

Jim
hcarr01
Level VI

Re: date format

Thank you for your answers !

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

Recommended Articles

No recommendations found