2

I searched around on Stack Overflow for a post that explained all the different variations in the possibilities of uploading dates from an Excel sheet, with all of its various formatting styles, with PHP, and the problems that can occur from this with dates not being grabbed correctly, and I could not find anything that captured every variation, so I wrote my own function.

I feel that this could be useful to others, (as it seems like there are several posts on it,) but I don't know if I can just post code that's meant to help and is not an actual question.

Can I do this?

Where do I do this? Should I find a random question that my code somewhat answers? Start a new post?

8
  • That sounds way too broad for a stack question, even if it has an answer
    – Patrice
    Commented Sep 3, 2015 at 15:46
  • 7
    No, list questions are off-topic. Consider a blog or a github project to publish code. Commented Sep 3, 2015 at 15:46
  • 2
    So how can you be sure that your function captures all variations? Isn't it closer to the truth that it captures all the variations that you specifically find useful for your specific needs?
    – Gimby
    Commented Sep 3, 2015 at 15:59
  • @Gimby - of course. It doesn't capture every possible variation, it's written for UTF encoding, and for dates that are supposed to be in US format eventually - I would state that in my post of course, but I didn't want to go into incredible detail here, I just wanted to know if SO had a place to post stuff like this. Commented Sep 3, 2015 at 16:22
  • Just giving you an angle on this to reason why it is NOT fit for SO - this situation is all about you. The fact that you want to share your efforts is a very nice thing of you, but SO begins with either asking a question, or finding a question. If you can't do that, which will usually be the case with you-specific things, then its a no-go.
    – Gimby
    Commented Sep 3, 2015 at 18:08
  • Good logic - and you're right. If it's going to be useful to someone out there, there's probably already a question on it. If there isn't, it's probably an issue that's relegated just to me. I'll do some more digging! Commented Sep 3, 2015 at 18:09
  • How long is the code?
    – xdhmoore
    Commented Sep 3, 2015 at 23:34
  • If you can write a clear, concise question that describes the problem you're trying to solve, you can then post your own self-answer using the content you're describing. Be forewarned, though: both your question and the answer you post to it will be held to the same standards as any other SO question, which means that if either of them is not well-written and within the site guidelines, you'll be subject to downvoting or closure just like any other question or answer. See Can I answer my own question? for more information.
    – Ken White
    Commented Sep 4, 2015 at 0:51

1 Answer 1

1

You might write a question about one variation of the problem, a question that is precise and meets all the Stackoverflow rules about questions. Then write an answer with two parts. The first part answers the question but no more. The second part says there are many variations of the problem and shows how to solve many of them.

Not the answer you're looking for? Browse other questions tagged .