Time Again for MySQL

Started by stanl, February 06, 2014, 08:07:20 AM

Previous topic - Next topic

stanl

I will be working with a MySQL 5.1 backend in a couple weeks (it is remote). I will be testing the feasibility of using either an Access db with linked tables, or the 5.2 ANSI drivers directly.  One thing I already discovered. Their datetime masks use %, as in '%m/%d/%Y %H:%i:%s' 

But you don't have to double-up to %% as you would in other cases (so it doesn't act like the WB macro variable replace). Curious.

First question, does anyone know a more effcient way to convert a double to a DateTime in MySQL rather than

DATE_FORMAT(ADDDATE(ADDDATE(ADDDATE('1899-12-31 00:00:00',[dbl]), INTERVAL -2 DAY),INTERVAL(MOD([dbl],1)*86400)SECOND),'%m/%d/%Y %H:%i:%s')

JTaylor

Will the from_unixtime() function be what you need?

Jim

stanl

Quote from: JTaylor on February 06, 2014, 08:22:58 AM
Will the from_unixtime() function be what you need?

Jim

Yeah, but the double is actually in OLE Time - so this worked

FROM_UNIXTIME((A.AVAIL_TIMESTAMP - 25569.0)*86400,'%m/%d/%Y %H:%i:%s') AS TimeIn