SET @expiredtimestamp = DATEFORMAT(NOW() - INTERVAL 23 MINUTE, '%Y-%m-%d %H:%i:%s');
SET @validdatetime = DATEFORMAT((NOW() - INTERVAL 42 DAY), '%Y-%m-%d');
SELECT
column_with_datetime,
@expiredtimestamp AS 'expiredtimestamp',
@validdatetime as 'validdatetime'
FROM
my_table
WHERE
column_with_datetime >= @valid_datetime;
Since php 5.4. throws his shadow i finally had some time to check the release notes of 5.3. Here are some changes that are made in PHP 5.3, i just picked up my favorits (as expected ).
New Functions
arrayreplace: replaces elements from passed arrays into the first array
arrayreplacerecursive: replaces elements from passed arrays into the first array recursively
classalias: rreates an alias for a class
header_remove: remove previously set headers
I have not used one of this functions but since i am a developer i knew a lot of situations where this functons could have saved time.
other changes to extensions
cURL: cURL now supports SSH
OpenSSL: OpenSSL digest and cipher functions are now supported.
Session: Sessions will no longer store session-files in "/tmp" when open_basedir restrictions apply, unless "/tmp" is explicitly added to the list of allowed paths.
new methods
DateTime::add(): Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object
DateTime::diff(): Returns the difference between two DateTime objects.
DateTime::sub(): Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object.