[opencms-dev] mySql query

Christoph P. Kukulies kuku at physik.rwth-aachen.de
Fri Apr 25 20:41:43 CEST 2008


On Fri, Apr 25, 2008 at 11:35:39AM -0600, TechnoSophos wrote:
> OpenCms stores dates in microseconds since epoch (see java.util.Date).

milliseconds ! :-)

> MySQL uses seconds since epoch. So you can get approximate times with
> this:
> 
> SELECT FROM_UNIXTIME(user_lastlogin / 1000) from CMS_USERS;
> 
> Matt

Thanks. I firgured out this afternoon. Never dealt much with date
conversions and such. But discovered the DateFormat class while playing
around.

Actually I didn't need a conversion into MySql DATE type. I just needed 
a list of all my users and their last login date/time. The workplace
function gives functionality this but I needed a differently formatted table
in a handier format than screen copies and the way it was spread over
multiple pages in the OpenCMS adminstration workplace.

But thanks anyway.

--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de



More information about the opencms-dev mailing list