Welcome To Snipplr


Everyone's Recent Snippets Tagged format



Python allows for strings to be formatted using a predefined format string with a list of variables. The following is an example of using multiple format strings to display the same data:
0 1332 posted 16 years ago by magicrebirth
I written this code to parse apache log in common log formats. It may have problems with irresponsible formatting like non-concluded into quotes request line. I welcome any modifications to my snippet because it was written if short time and this is...
0 1472 posted 16 years ago by mpontus
This snippet collects a date from a var and formats it into the correct format for database date entry
0 1561 posted 16 years ago by daveismyname
this function formats a web address for use in a link.<br> echo formatWebAddress("google.com");<br> http://www.google.com/
1 1531 posted 16 years ago by jlvallelonga
1 1752 posted 16 years ago by martin_rusev
2 1559 posted 16 years ago by blackf0rk
This code was adapted from a snippet I found somewhere awhile back... can't claim complete credit
1 1810 posted 16 years ago by iloveitaly
For some reason it took me a bit to realize that you had to use datetime.datetime
0 1322 posted 16 years ago by iloveitaly
this function processes a URL that 'should' be a full url (i.e. http://something.com/dfsdfs/) and makes sure it contains http:// for easy inclusion as a link into a href attribute
0 1182 posted 16 years ago by iloveitaly
0 1289 posted 16 years ago by beresovskiy
Here are some example string formats. As I discover more I will add them here.
6 1832 posted 16 years ago by stewshack
It's important that the newPn var that you pass into the Convert.ToInt64 function is in the xxxxxxxxxx format and that no characters are present.
1 2343 posted 16 years ago by blackf0rk
This is the custom layout template i use for the CleanCSS website, very handy!
0 1483 posted 16 years ago by 1man
this function formats a web address for use in a link
2 1631 posted 17 years ago by jlvallelonga
Annoyingly hard to find, I'm sure others out there have felt the pain of converting sas dates to oracle date formats. example: data _null_; x_dt = datetime(); x_d = date(); put x_dt oracle_datetime.;...
0 4118 posted 17 years ago by vasdee
Example: `var result = "Hello {0}! This is {1}.".format("world","foo bar");` Returns: `"Hello World! This is foo bar."`
2 2100 posted 17 years ago by jasonseney
Format date from yyyy-mm-dd hh:mm:ss TO yyyymmddhhmmss
1 2897 posted 17 years ago by gfazioli
Adds commas to numbers. 1234567 becomes 1,234,567
1 2091 posted 17 years ago by jdstraughan
0 2736 posted 17 years ago by morroida
I use this in addition to the number_format (http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/) snippit in SWFUpload to display the size of files a user is preparing to upload.
0 6439 posted 17 years ago by inkdeep
This changes the date format from y-m-d to d-m-y on PHP
3 4510 posted 17 years ago by isaac
This changes the date format from y-m-d to d-m-y on PHP. It's easy to change the - to / or spaces...
0 2773 posted 17 years ago by isaac
This changes the date format from d-m-y to y-m-d on PHP. It's easy to change the - to / or spaces...
1 3052 posted 17 years ago by isaac
Colour code table cells to help visually reveal results.
0 1308 posted 17 years ago by webonomic
The code below will format 2008-01-30 10:58:32 to Jan 30, 2008 See the page http://us2.php.net/date for a complete list of formatting codes.
2 2054 posted 18 years ago by meme
This is an extension to Ruby's String class. Just put this code in a file and include it. This basically takes a string and adds literals and padding to it. For example, you can format a phone number with optional area code like this: "5445556...
1 1669 posted 18 years ago by Agent
De aa-mm-dd a dd-mm-aa y al revé
3 1659 posted 18 years ago by nicolaspar
1 1738 posted 18 years ago by chrysanth