php - Error converting a numeric month into textural representation -
I use the following code in php in textural representation to change months in months.
Date ('M', Strottomium (8));
But for every issue I am getting 'December' as my month.
How should I work it
Thanks Gyan
But for each issue, I am 'December' as my month.
It's no wonder: strtotime (8)
will give you 0
- and it is January 1, 1970, 0:00 : 00 UTC, in your local time zone (where was still December at that point).
You can use
$ month = 8; Date ("m", strotomom ("1970-$ month -01"));
( 1970
is totally irrelevant - it can be any year.)
Alternatively, maybe more beautiful, Use code> mktime () as shown by Nike.
Comments
Post a Comment