<i id='XqYGZ'><tr id='XqYGZ'><dt id='XqYGZ'><q id='XqYGZ'><span id='XqYGZ'><b id='XqYGZ'><form id='XqYGZ'><ins id='XqYGZ'></ins><ul id='XqYGZ'></ul><sub id='XqYGZ'></sub></form><legend id='XqYGZ'></legend><bdo id='XqYGZ'><pre id='XqYGZ'><center id='XqYGZ'></center></pre></bdo></b><th id='XqYGZ'></th></span></q></dt></tr></i><div id='XqYGZ'><tfoot id='XqYGZ'></tfoot><dl id='XqYGZ'><fieldset id='XqYGZ'></fieldset></dl></div>

    <bdo id='XqYGZ'></bdo><ul id='XqYGZ'></ul>
<tfoot id='XqYGZ'></tfoot>
  • <small id='XqYGZ'></small><noframes id='XqYGZ'>

    1. <legend id='XqYGZ'><style id='XqYGZ'><dir id='XqYGZ'><q id='XqYGZ'></q></dir></style></legend>

      1. Drupal 7 架构中的日期时间类型

        Datetime type in Drupal 7 schema(Drupal 7 架构中的日期时间类型)
      2. <tfoot id='I8jT3'></tfoot>

          <small id='I8jT3'></small><noframes id='I8jT3'>

            <bdo id='I8jT3'></bdo><ul id='I8jT3'></ul>
            <legend id='I8jT3'><style id='I8jT3'><dir id='I8jT3'><q id='I8jT3'></q></dir></style></legend>

              <tbody id='I8jT3'></tbody>
          • <i id='I8jT3'><tr id='I8jT3'><dt id='I8jT3'><q id='I8jT3'><span id='I8jT3'><b id='I8jT3'><form id='I8jT3'><ins id='I8jT3'></ins><ul id='I8jT3'></ul><sub id='I8jT3'></sub></form><legend id='I8jT3'></legend><bdo id='I8jT3'><pre id='I8jT3'><center id='I8jT3'></center></pre></bdo></b><th id='I8jT3'></th></span></q></dt></tr></i><div id='I8jT3'><tfoot id='I8jT3'></tfoot><dl id='I8jT3'><fieldset id='I8jT3'></fieldset></dl></div>
                • 本文介绍了Drupal 7 架构中的日期时间类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在编写一个新的 Drupal 7 模块(Drupal 7.10,已安装日期 7.x-2.0-rc1,已安装架构 7.x-1.0-beta3)我在 mymodule.install 中定义了一个表:

                  I'm writing a new Drupal 7 module (Drupal 7.10, Date 7.x-2.0-rc1 installed, Schema 7.x-1.0-beta3 installed) i defined a table in mymodule.install:

                  $schema['museums_tickets']= array(
                      'fields' => array(
                          'nid' => array(
                          'type' => 'int',
                          'unsigned' => TRUE,
                          'not null' => TRUE,
                      ),
                      'day' => array(
                          'type' => 'datetime', 
                          'mysql_type' => 'DATETIME',
                          'not null' => TRUE,
                      ),
                      'tickets' => array(
                          'type' => 'int',
                          'unsigned' => TRUE,
                          'not null' => TRUE,
                          ),
                      'ticket_code' => array(
                              'type' => 'varchar',
                              'length' => 32,
                              'not null' => TRUE, 
                              'default' => '',
                          ),
                      ),
                      'primary key' => array('nid', 'day','ticket_code'),
                  );
                  

                  但我收到以下错误:

                  Field museums_tickets.day: no Schema type for mysql type datetime.
                  museums_tickets.day: no type for Schema type datetime.
                  Field museums_tickets.day: no Schema type for type datetime. 
                  

                  如果我使用同样适用

                  'type' => 'datetime:normal',
                  

                  我想知道如何解决这个问题.我不想将日期存储为时间戳,因为另一个人写了很多代码,显然我不想重写所有代码.我已经看过 drupal 7 custom schema error datetime 但答案没有工作.也许我做错了什么,但我没有找到.

                  I would like to know how to solve this problem. I don't want to store dates as timestamp, since another person wrote a lot of code and obviously i don't want to rewrite all. I already looked at drupal 7 custom schema error datetime but the answer doesn't work. Maybe i'm doing something wrong, but i don't find what.

                  提前致谢.

                  推荐答案

                  如果您查看 Date 模块的架构,您会发现类似

                  If you look in the schema of the Date module you will find something like

                  'day' => array(
                      'type' => 'datetime',
                      'mysql_type' => 'datetime',
                  )
                  

                  实际上,Clive 的答案是我第一个选择的,但后来给我的 Views 模块带来了问题.

                  Actually the answer of Clive was the one i picked first but later gave me problems with the Views module.

                  Date 模块的这个实现拯救了我的一天

                  This implementation of the Date module save my day

                  这篇关于Drupal 7 架构中的日期时间类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <small id='3Yrif'></small><noframes id='3Yrif'>

                  • <bdo id='3Yrif'></bdo><ul id='3Yrif'></ul>

                      <legend id='3Yrif'><style id='3Yrif'><dir id='3Yrif'><q id='3Yrif'></q></dir></style></legend>

                            <tbody id='3Yrif'></tbody>

                          1. <tfoot id='3Yrif'></tfoot>
                            <i id='3Yrif'><tr id='3Yrif'><dt id='3Yrif'><q id='3Yrif'><span id='3Yrif'><b id='3Yrif'><form id='3Yrif'><ins id='3Yrif'></ins><ul id='3Yrif'></ul><sub id='3Yrif'></sub></form><legend id='3Yrif'></legend><bdo id='3Yrif'><pre id='3Yrif'><center id='3Yrif'></center></pre></bdo></b><th id='3Yrif'></th></span></q></dt></tr></i><div id='3Yrif'><tfoot id='3Yrif'></tfoot><dl id='3Yrif'><fieldset id='3Yrif'></fieldset></dl></div>