I am having trouble finding how exactly to write a fairly simple line of code. I want to get the previous month single digit to a string ex. for today would be “2”.
So far I have system.datetime.now.addmonths(-1).tostring(“M”) but it is giving me “February 27”. how can i change this for it to give the single digit of previous month like “2”
is there no way to get datetime.now to spit out the previous month with just one digit? that way seems overly complicated especially when it comes to january.