Whenever I've started to make "replacement for &foo" things, I've found it helpful to ask myself "why would people choose to use my replacement than the original &foo?"
99 out of 100, it's been "I guess they wouldn't.", and the hundredth time was because of some data validation I was performing on $bar before it was transformed by &foo, so I doubt it could even be called a replacement, but probably more of a wrapper. Asking this question of myself has saved me from writing some (potentially) bad code.

In fact, I see that in the heart of your code lies this :

$Inp=~s/%([\d.-]*)([smhDMYy])/sprintf("%$1d",eval "\$$2")/ge;
So this really isn't a replacement for sprintf, but an enhancement thereof.
Also, in addition to Kanji's suggestion of POSIX, there's also the (to borrow a phrase) the all-singing, all-dancing Date::Manip.

In reply to (boo)Re: Subroutine for returning a date, similar to sprintf by boo_radley
in thread Subroutine for returning a date, similar to sprintf by leons

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.