cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
nadershakerin0
Level II

Converting Military Time Format (hhmm) to Time Format (hh:mm)

I need to convert military time in the hhmm format, e.g. 1432 or 725 to hh:mm format e.g. 14:32 to 7:25.  Is there a simple formula that can make the conversion, or should I use a script for it?  Thanks.

11 REPLIES 11
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Converting Military Time Format (hhhh) to Time Format (hh:mm)

Still another approach that avoids strings altogether:

 

 

dt << New Column( "time",
    Numeric,
    "Continuous",
    Format( "hr:m", 12 ),
    Formula( Floor( :Military / 100 ) * 3600 + Mod( :Military, 100 ) * 60 )
);

 

khoepfl
Level I

Re: Converting Military Time Format (hhhh) to Time Format (hh:mm)

How about converting from Military Time to regular?