Modified Javascript

Is there any direct function available in Javascript to get the month in text format from the date?

Hi Sagar,

No, there is no direct function is available. You can get the month in numeric format with the help of getMonth() or month() function and then can use array to convert it into text format.


you could try something like this in Modified Java Script Value Step:

var today = new Date();
var dd = today.getDate();
var month = new Array();
month[0] = “JAN”;
month[1] = “FEV”;
month[2] = “MAR”;
month[3] = “ABR”;
month[4] = “May”;
month[5] = “JUN”;
month[6] = “JUL”;
month[7] = “AGO”;
month[8] = “SET”;
month[9] = “OUT”;
month[10] = “NOV”;
month[11] = “DEZ”;
var mm = month[today.getMonth()];
var yyyy = today.getFullYear();

if(dd<10) {
dd = ‘0’+dd

if(mm<10) {
mm = ‘0’+mm
today = dd + ‘/’ + mm + ‘/’ + yyyy;

Conver month number to Month name using Modified javascript. In Format of ‘MMM’

var month=(date2str(dob,“MMM”,“EN”));


//var dates = Month;
var dates = month(DOB);
var Month=“Jan”;
else if(dates==1){
var Month=“Feb”;
else if(dates==2){
var Month=“Mar”;
else if(dates==3){
var Month=“Apr”;
else if(dates==4){
var Month=“May”;
else if(dates==5){
var Month=“Jun”;
else if(dates==6){
var Month=“Jul”;
else if(dates==7){
var Month=“Aug”;
else if(dates==8){
var Month=“Sep”;
else if(dates==9){
var Month=“Oct”;
else if(dates==10){
var Month=“Nov”;
else {
var Month=“Dec”;