Welcome To Snipplr


Everyone's Recent Snippets Tagged date



1 ... 6 7 8 9 10 Next »
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 1816 posted 17 years ago by meme
A simple but usefull smarty plugin to convert a unix timestamp to any date format. Usage: {$var|convertunix:"d-m-Y"}
2 1904 posted 17 years ago by FrankBr
Taken from : http://www.phpfreechat.net/forum/viewtopic.php?pid=7587 See also this class : http://www.phpbuilder.com/snippet/download.php?type=snippet&id=2205
1 1009 posted 17 years ago by clapfouine
Easiest way to get the last day in the current month.
2 1810 posted 17 years ago by alli14404
This routine is loosely based on elightbo's "Calculate Business Days" snippet in ASP, with some process & logic modifications (most notably accounting for situations when both dates fall on a weekend) and a translation to JavaScript.
0 5823 posted 17 years ago by Bluebeard
0 3427 posted 18 years ago by nicolaspar
Convert 12hs format to 24hs format. In example: 10:00:00 a.m. return timestamp for 22:00. Or use: strtotime('1970-01-01 '.$hora);
1 1202 posted 18 years ago by nicolaspar
2 2599 posted 18 years ago by depmed
like PHP's 'jS'
0 2342 posted 18 years ago by ches
echo validarFecha( '1-1-1998', 0 ) ? 'ok' : 'ko' ; #ok echo validarFecha( '1-1-1998' ) ? 'ok' : 'ko' ; #ko echo validarFecha( '1980/05/06' ) ? 'ok' : 'ko' ; #ok echo validarFecha( '1700-5-1' ) ? 'ok' : 'ko' ; #ok
0 1295 posted 18 years ago by nicolaspar
First, create two new fields in your table "Created", and "LastModified" as "datetime" fields, being sure to allow nulls. Then run this code as a query to create triggers that will update the appropriate field when a record is modified, or a record...
1 2683 posted 18 years ago by jeffxl
De aa-mm-dd a dd-mm-aa y al revé
3 1479 posted 18 years ago by nicolaspar
2 things here. currency (euro) with in a 2.00 format and select entries older than 4 weeks = 28 days
2 1535 posted 18 years ago by assbach
useful if a "valid until" should have an exact ( in this case far future ) value.
0 1112 posted 18 years ago by assbach
it's an excerpt of a registration form with 3 pulldowns for birthday ( day, month, year ) check for empty vars and applying CSS classes to show error on "empty" fields. there are probably better ways, but this works for me. any suggestions welcome.
1 3478 posted 18 years ago by assbach
1 2139 posted 18 years ago by olive
0 2382 posted 18 years ago by olive
The names of the months, as returned by date('M', ...)
1 1409 posted 18 years ago by collin
You can use this script to always keep the copyright notice on the footer of your website current. For example, instead of having to update the year at the beginning of each year, this script will display current year. I'm sure there's an easier way...
2 1405 posted 19 years ago by jonhenshaw
0 1328 posted 19 years ago by roberocity
2 2453 posted 19 years ago by gdonald
0 1071 posted 19 years ago by olive
To check it: hwclock, date
0 1312 posted 19 years ago by yuconner
3 1533 posted 19 years ago by webDesign
Converts a date/time from one timezone to another.
0 1818 posted 19 years ago by vijucat
1 ... 6 7 8 9 10 Next »