Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged date



This simple function allows you to find a weeks position in the month based on a given date. For instance I needed to alert the user their date was the "Second Week Of January" during a given month. I may never use it again but it came in very hand...
0 4362 posted 14 years ago by aristoworks
The date format is dd/mm/YYYY but you can replace slashes by anything else.
0 1467 posted 14 years ago by ptiswitz
0 1219 posted 14 years ago by sedgemonkey
These are some date functions. Get Current Week Start Date Get Current Week End Date Get Current Month Start Get Current Month End Get Current Year Start Get Current Year End and these functions can help you getting last week's start date...
0 1212 posted 15 years ago by aamirrajpoot
This takes a date like so: Sat, 08 Jan 2011 from a database and allows you to use it in your code. For example if you wanted to work out a week from Sat, 08 Jan 2011 it can be done with ease. I created this for a project i am currently working on. Th...
0 1206 posted 15 years ago by JonnySnip3r
Use this function if you need to get the same day in the next month (or how many you need). Using defaults functions of php you got this: echo date('Y-m-d', strtotime( " + 1 month " , strtotime('2010-01-31'))); (Output: '2010-03-03') and if yo...
0 1188 posted 15 years ago by vitorbari
Nice and short
0 1245 posted 15 years ago by Blerx
Useful for copyright. Keeps date current.
0 1273 posted 15 years ago by bombadda
Here is a little bit of code I use from time to time to make a generic some what safe date selector for forms. I wanted something easy, small, and not relying on images, jquery, libraries, etc... Most importantly I wanted the date that was selected t...
0 1240 posted 15 years ago by brownrl
0 1246 posted 15 years ago by laurentzziu
0 1408 posted 15 years ago by sandrews_06
0 1379 posted 15 years ago by YourListing
Useful for displaying copyright notices on a website.
0 1537 posted 15 years ago by f6design
1 1223 posted 15 years ago by sjacunningham
echo's: 2008 / 10 - Company name
0 1214 posted 15 years ago by withinmedianl
Always forget the correct way of putting this.
0 1200 posted 15 years ago by jhonqwerty
2 2865 posted 15 years ago by stamba
1 1092 posted 15 years ago by metoikos
First you have to add a custom value with a correct date format. The lines: `AND CAST(wpostmeta.meta_value AS DATE) > '".date("Y-m-d H:i:s")."' AND CAST(wpostmeta.meta_value AS DATE) < '".date("Y-m-d H:i:s", $date2)."' ` are only used to select d...
0 2114 posted 15 years ago by Mat_
1 1560 posted 15 years ago by Mat_
Grabbed from parsing magento's source code
0 1281 posted 15 years ago by dmistriotis
0 1177 posted 15 years ago by mfigge
0 1435 posted 15 years ago by alexandrepayet
Working on creating a 'days ago' script. I know some already exist, but I just want to know how to do it myself. I'm also incorporating leap year functionality and some utility functions that could be used on other projects.
2 2765 posted 15 years ago by alvincrespo
Questo snippet modifica la posizione della data del post se questo è più vecchio di trenta giorni dalla data di pubblicazione.
0 1199 posted 15 years ago by gavello