From: Claudio Nanni Date: March 1 2011 5:47pm Subject: Re: Convert unix time to 12:00 AM of that same day List-Archive: http://lists.mysql.com/mysql/224539 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba6136643b4a8c049d6f6307 --90e6ba6136643b4a8c049d6f6307 Content-Type: text/plain; charset=ISO-8859-1 You can start by using 60*60*24=86400 ;) On Mar 1, 2011 6:17 PM, "Bryan Cantwell" wrote: > I'd asked before how to convert a unix timestamp to the hour that it is > in (and got the perfect answer) : > 1298999201 = 3/1/2011 11:06:41 AM > (1298999201 - (1298999201 % 3600)) = 3/1/2011 11:00:00 AM > > Now getting the timestamp converted to midnight of that same day isn't > as simple as: > 1298999201 - (1298999201 % 85400) > That just gives me a unix time from yesterday... > > How can I convert 1298999201 (3/1/2011 11:06:41 AM) to 1298959200 > (3/1/2011 12:00:00 AM)? > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=claudio.nanni@stripped > --90e6ba6136643b4a8c049d6f6307--