JS version of PHP's strftime()