Solved

php relative date

Posted on 2014-10-24
2
170 Views
Last Modified: 2014-10-25
Hi experts
I need a function that return  relative date... Today, yesterday, this week, this month... Month of xxxx.  I need yesterday like in real life starting a midnight and not 24hours ago.

Thanks for your help
0
Comment
Question by:abouerez
2 Comments
 
LVL 17

Accepted Solution

by:
selvol earned 500 total points
ID: 40403572
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40404051
This article tells how to use date/time values in PHP.
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

See Practical Application #3a, and please post back if you still have any questions about what works with strtotime().
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Query return divisible by 3 3 25
Custom Wordpress Loop 22 38
PHP breaks when used in Wordpress template file 3 30
Reference key in foreach loop 4 15
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question