You could ask a canonical self-answered question, which is basically a "fake" question with a presupplied answer. The question would be something like "How can I get the day of the week from a date?", and the answer would be your script -- included entirely in the answer -- with an explanation of what it does, its constraints, etc. The benefits of this approach are that if someone has a better solution, they can post it. I'd suggest not accepting your own answer for at least a couple of days, to encourage other people to contribute.
Before doing this, make sure to check for any preexisting canonical questions, or yours will get closed as a dupe. Search well. If you find nothing that's similar, post it as your own Q&A pair.
[NB: This question is highly related. Before you post your own, make sure that it doesn't answer that question; if it does, post it as an answer there.]
You'll also want to make sure that your solution is as bugfree as possible.