I tried to force the foreskin back when it is erected
Hmmm... why are you taking antibiotics? Is that somehow related to this issue? Often they’re prescribed for Prostatitis, which usually causes pain more in the prostate itself, perineal region or anal area, not usually the penis itself. Also, do you have a very tight foreskin? I’m circumcised myself, but I think normally the foreskin retracts enough during erection that the ‘head’ is exposed. You may need to see a Urologist for examination. I don’t think this is serious & may get better on its own, but these other questions may need addressing...
Well, it sounds like you might have two separate issues - one related to the foreskin that's too tight, and the other does sound like possible prostatitis. It's also possible the two are related, but I think that's less likely. In both cases, I would recommend seeing your regular Dr. first, and if he/she is not able to help, see a Urologist - they specialize in all types of problems related to male genitalia & functional problems. I believe there is a very minor procedure (possibly done right in the office w/ local anesthesia) where they can snip the foreskin just a bit so that it retracts more easily. In the meantime I think the pain will mostly diminish if you give it a little rest...
I can't say for sure how long this would take to heal - maybe anywhere from several days up to possibly a couple weeks. But see what the Uro says - glad to hear you made the app't. - hopefully you'll have an answer & the correct treatment soon...
No prblm, glad to help, hope this advice was useful...