Names Default to Here( 1 );
// make data like 01h17m03s
dt = New Table( "Time",
Add Rows( 10 ),
New Column( "Original", Character, Ordinal ),
New Column( "Converted", Numeric, Continuous, Format( "H:M:S" ) )
);
// utility
padded = Function( { l, h }, { v },
v = Random Integer( l, h );
v = If( v < 10, "0", "" ) || Char( v );
);
// populate original value
For Each Row(
h = padded( 0, 24 );
m = padded( 0, 60 );
s = padded( 0, 60 );
:Original = Concat( h, "h", m, "m", s, "s" );
);
// now convert it to JMP time number
For Each Row(
:Converted = Eval(
Parse(
Regex( :Original,
"(\d\d)h(\d\d)m(\d\d)s",
"\3 + 60*(\2) + 3600*(\1)"
)
)
)
);