Parse Month (in 3 letter abbreviation) from Date TimeHello,
I have a Date Time column containing dates in the following format of (dd/mm/yyy):
01/03/2017
01/01/2017
01/12/2017
How can I use JSL to parse the month so that it would return:
Mar
Jan
Dec
Thank you so much for your help
Re: Parse Month (in 3 letter abbreviation) from Date TimeHi Craige,
Thank you so much for the help. The original column was in a date time format. So I ended up using the following JSL code:
dt << New Column("Month", Formula(Substr( Format( :Date Time, "ddMonyyyy" ), 3, 3 )));Re: Parse Month (in 3 letter abbreviation) from Date TimeIt is not clear if your column is a character column or a date-formatted numeric column. Here's a way to get the 3-letter month names from JMP without building a 12-item lookup table:
x=informat("01/12/2017","d/m/y"); // use this if the data is character, creates a date-time value
y=format(x,"ddMonyyyy"); // use this to get a string from a date time: "01Dec2017"
z=substr(y,3,3); // use this to pick out the month: "Dec"You can also ask the date time value for the day, month, and year parts as numbers: month(x), day(x), year(x).