Date Time issueI have a character-based date time field which is exported from an electronic health record which is in the syntax:
mm/dd/yy hhmm
I need to convert this to a usable date-time field.
I have found solutions for converting hhmm alone to JMP-acceptable time. How do I get this entire field converted?
I am very new to JMP and have no code writing experience or even basic knowledge. I can cut and paste a solution to the right place.
Thanks!
Re: Date Time issueWorks perfectly!
Thanks for the really quick response!
Joe
Re: Date Time issueThanks!
Have to go in for an evening sahift. Will apply tomorrow
Re: Date Time issueSee my edited previous response
Re: Date Time issueyes always mm/dd/yy hhmm
Re: Date Time issueI need an additional piece of information......are the time fields always 4 numbers......0101 etc.? Or if not, how would 0101 be specified?
Once again I will assume....that if the seconds are always a 2 digit field, the following script can be run to add in the ":" between the minutes and seconds. And then you can apply the suggestion from my first response. I am using the column reference of :DateTime as the name for your column that has the date/time values. Just change it out for the actual name of the column......Make sure you keep the ":" preceding the column name
Names Default To Here( 1 );
dt = Current Data Table();
For Each Row(
:DateTime = Substr( :DateTime, 1, Length( :DateTime ) - 2 ) || ":" ||
Right( :DateTime, 2 )
);
Re: Date Time issueActually - that assumption is the issue - no delimiter. Found the above process before. Also your post about how to convert hhmm to hh:mm, but don't know how to apply to the field with the date infront of it.
Re: Date Time issueRight click on the header for the column and select Column Info
Change the Data Type from character to numeric
Change the Modeling Type that will now display, from Nominal to Continuous
Click on the Format down arrow and select "Time==>m/d/y h:m"
Click on Apply
Your dates should be converted from character to numeric
I am making one assumption, and that is that your hhmm actually has a delimiter between them, such as hh:mm
If it is truely hhmm with no separation, then a different approach will have to be used. Respond back on your success, or if there are issues.