List:General Discussion« Previous MessageNext Message »
From:Pintér Tibor Date:February 24 2011 5:09pm
Subject:Re: Get date from unix_timestamp only up to the hour
View as plain text  
On 02/24/2011 05:56 PM, Nathan Sullivan wrote:
> Bryan,
> 
> Maybe something like this would work?
> 
> select 1296158500 - (1296158500 % 3600)

ah, yes, even this one:

mysql> select now() - interval (unix_timestamp() % 3600) second;
+---------------------------------------------------+
| now() - interval (unix_timestamp() % 3600) second |
+---------------------------------------------------+
| 2011-02-24 18:00:00                               |
+---------------------------------------------------+
1 row in set (0.00 sec)

t
Thread
Get date from unix_timestamp only up to the hourBryan Cantwell24 Feb
  • Re: Get date from unix_timestamp only up to the hourNathan Sullivan24 Feb
    • Re: Get date from unix_timestamp only up to the hourBryan Cantwell24 Feb
    • Re: Get date from unix_timestamp only up to the hourPintér Tibor24 Feb
  • Re: Get date from unix_timestamp only up to the hourMichael Dykman24 Feb
  • Re: Get date from unix_timestamp only up to the hourPintér Tibor24 Feb