Format of Month
Posted: Sun 12 Jul 2015 9:27 pm
Hi Everyone,
Have been changing some php templates to accomodate the new formatting of Date / Time in MX. However, I came across a slight problem when using the "M" format. I expected this to return the month as a single digit i.e. "7" for July but it returns 01 July.
Have scoured the forum and the wiki but cant find an answer unfortunately.
I did a little php script to check other date formats to make sure I understood and all the results seem to be as i expected except the "M" (first in the list). Am I doing something wrong or does anybody know where I can look for the answer.
I went back to my version of 1.9.4 and the 'm' formatting qould return a single digit i.e. "7"
Results of my test below
$MonthTempHD = "<#MonthTempHD format="M">"; Returns "1 July";
$MonthTempHD = "<#MonthTempHD format="MM">"; Returns "07";
$MonthTempHD = "<#MonthTempHD format="MMM>"; Returns "Jul";
$MonthTempHD = "<#MonthTempHD format="MMMM">"; Returns "July";
$MonthTempHD = "<#MonthTempHD format="d">"; Returns "01/07/2015";
$MonthTempHD = "<#MonthTempHD format="dd">"; Returns "01";
$MonthTempHD = "<#MonthTempHD format="ddd">"; Returns "Wed";
$MonthTempHD = "<#MonthTempHD format="dddd">"; Returns "Wednesday";
$MonthTempHD = "<#MonthTempHD format="D">"; Returns "01 July 2015";
$MonthTempHD = "<#MonthTempHD format="yy">"; Returns "15";
$MonthTempHD = "<#MonthTempHD format="yyyy">"; Returns "2015";
Thanks
Andy
Have been changing some php templates to accomodate the new formatting of Date / Time in MX. However, I came across a slight problem when using the "M" format. I expected this to return the month as a single digit i.e. "7" for July but it returns 01 July.
Have scoured the forum and the wiki but cant find an answer unfortunately.
I did a little php script to check other date formats to make sure I understood and all the results seem to be as i expected except the "M" (first in the list). Am I doing something wrong or does anybody know where I can look for the answer.
I went back to my version of 1.9.4 and the 'm' formatting qould return a single digit i.e. "7"
Results of my test below
$MonthTempHD = "<#MonthTempHD format="M">"; Returns "1 July";
$MonthTempHD = "<#MonthTempHD format="MM">"; Returns "07";
$MonthTempHD = "<#MonthTempHD format="MMM>"; Returns "Jul";
$MonthTempHD = "<#MonthTempHD format="MMMM">"; Returns "July";
$MonthTempHD = "<#MonthTempHD format="d">"; Returns "01/07/2015";
$MonthTempHD = "<#MonthTempHD format="dd">"; Returns "01";
$MonthTempHD = "<#MonthTempHD format="ddd">"; Returns "Wed";
$MonthTempHD = "<#MonthTempHD format="dddd">"; Returns "Wednesday";
$MonthTempHD = "<#MonthTempHD format="D">"; Returns "01 July 2015";
$MonthTempHD = "<#MonthTempHD format="yy">"; Returns "15";
$MonthTempHD = "<#MonthTempHD format="yyyy">"; Returns "2015";
Thanks
Andy