Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

Date format 'MMM DD, YYYY' or 'MM DD, YYYY'

I need to convert a date format from Aug 01, 2024 to 08/01/2024. Date#(VisitDate,'MM DD, YYYY'),'MM/DD/YYYY') doesn't work but Date#(VisitDate,'MMM DD, YYYY'),'MM/DD/YYYY') does. I'm wondering what's the difference between MMM and MM?

Thanks in advance!

Labels (6)
1 Solution

Accepted Solutions
QFabian
Specialist III
Specialist III

you are correct @wanyunyang , your initial question about MMM and MM, thats means how is going to be recognized or represented the month field, as number, for example for August MM = '08' and as text, MMM = 'Aug', 

QFabian

View solution in original post

4 Replies
sriram____777
Contributor II
Contributor II

T:
Load *,
Date(Date#(vistdate,'MMM DD YYYY'),'MM/DD/YYYY') AS NEWDATE;
Load * Inline [
vistdate
Aug 01 2024
];
QFabian
Specialist III
Specialist III

Hi @sriram____777 , i made a little changes to onsidered the comma in the date :

T:
Load *,
Date(Date#(vistdate,'MMM DD, YYYY'),'MM/DD/YYYY') AS NEWDATE, ///sriram opt
Date(Date#(purgechar(text(vistdate), ','),'MMM DD YYYY'),'MM/DD/YYYY') AS NEWDATE2; // fq option
Load * Inline [
vistdate
"Aug 01, 2024"
];

QFabian
wanyunyang
Creator III
Creator III
Author

Hi @sriram____777 @QFabian , thank you for your responses, but I was wondering why MMM worked but MM didn't?

QFabian
Specialist III
Specialist III

you are correct @wanyunyang , your initial question about MMM and MM, thats means how is going to be recognized or represented the month field, as number, for example for August MM = '08' and as text, MMM = 'Aug', 

QFabian