For some reason the next_m object delivers an object that is considered 'chr NA' while the m_after object delivers the correct value (as of today, a character object of "03"). Previously the next_m object has delivered the intended result, however today it's giving the result described above. This is very strange given that m_after works fine. Does anyone know how I can fix this? Any help is greatly appreciated.
I need create an object that has the numeric version of the month in two digits, e.g March is 03 rather than just 3
According to the documentation, you should use the special operator %m+% to add days/months/years to a date object. It will also correct for impossible dates. So to update your code simply do this:
That is a character string. If you need it to be a character string representation of a portion of a Date object, which is typeof double while still keeping the object intact, it may take some doing.
On the other hand if you just need typeof character,