duanjian3920 2009-02-22 16:51
浏览 36
已采纳

重新创建/找到Joomla /社区生成器的“最新用户”模块。 MySQL / Joomla中的日期

When Joomla first sprung up and I moved over from Mambo I remember finding a component called Community Builder (CB) that extends the user-based interface behind Joomla.

I remember a small module I found in CB that displayed a couple of useful details about users that I want to be able to extract from my current project. These details included:

  • Total users registered
  • Total users registered per day
  • Total users registered per week
  • Total users registered per month
  • Latest user registered
  • Total visitors to the site

My question is how to recreate something very similar. I've been trying to construct an SQL statement that can manipulate the user table results and compare them to a set criteria eg. find all user's with a 'registerDate' variable within the last week.

The problem that has me lost is how to manipulate and compare a date string that resembles '2008-08-05 07:41:40'

  • 写回答

1条回答 默认 最新

  • duanba8070 2009-02-22 17:53
    关注

    The problem that has me lost is how to manipulate and compare a date string that resembles '2008-08-05 07:41:40'

    You can have MySQL turn this into a UNIX timestamp, or you can run it through strtotime.

    MySQL:

    SELECT UNIX_TIMESTAMP(datetime_field) FROM table
    

    strtotime:

    $timestamp = strtotime('2008-08-05 07:41:40');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比