Phpmyadmin feed a timestamp column with “0000-00-00 00:00:00”?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















in PhpMyAdmin (OVH Mutu), a table with column type timestamp.
Impossible to put into this colum a timestamp :
Always display datetime like 2017-01-09 23:02:01 !!!
It generate several problmes : default current_timestamp give in this table "0000-00-00 00:00:00". Calculate delays is impossible.
The only way : define a int(11) type column.
An idea ?...










share|improve this question
















bumped to the homepage by Community 16 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    in PhpMyAdmin (OVH Mutu), a table with column type timestamp.
    Impossible to put into this colum a timestamp :
    Always display datetime like 2017-01-09 23:02:01 !!!
    It generate several problmes : default current_timestamp give in this table "0000-00-00 00:00:00". Calculate delays is impossible.
    The only way : define a int(11) type column.
    An idea ?...










    share|improve this question
















    bumped to the homepage by Community 16 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      in PhpMyAdmin (OVH Mutu), a table with column type timestamp.
      Impossible to put into this colum a timestamp :
      Always display datetime like 2017-01-09 23:02:01 !!!
      It generate several problmes : default current_timestamp give in this table "0000-00-00 00:00:00". Calculate delays is impossible.
      The only way : define a int(11) type column.
      An idea ?...










      share|improve this question
















      in PhpMyAdmin (OVH Mutu), a table with column type timestamp.
      Impossible to put into this colum a timestamp :
      Always display datetime like 2017-01-09 23:02:01 !!!
      It generate several problmes : default current_timestamp give in this table "0000-00-00 00:00:00". Calculate delays is impossible.
      The only way : define a int(11) type column.
      An idea ?...







      mysql datetime timestamp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 13 '17 at 8:30









      a_horse_with_no_name

      41.4k779116




      41.4k779116










      asked Jan 9 '17 at 22:08









      JMBJMB

      62




      62





      bumped to the homepage by Community 16 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 16 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          If you need to calculate with the timestamp field, you simply may use SELECT UNIX_TIMESTAMP(yourtimestampfield);. I decided to use this instead of the int(11) because of the built in function on update CURRENT_TIMESTAMP which shows this format 0000-00-00 00:00:00.



          Also inside of mysql queries yo may use it the reverse way like UPDATE user SET logouttime = FROM_UNIXTIME(UNIX_TIMESTAMP(logintime)+3600) WHERE user_id = 12345;



          Hope this helps.






          share|improve this answer
























          • Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

            – JMB
            Jan 10 '17 at 8:49











          • Because a Unix timestamp is different than a SQL database timestamp.

            – ypercubeᵀᴹ
            Mar 31 '18 at 21:28












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f160472%2fphpmyadmin-feed-a-timestamp-column-with-0000-00-00-000000%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you need to calculate with the timestamp field, you simply may use SELECT UNIX_TIMESTAMP(yourtimestampfield);. I decided to use this instead of the int(11) because of the built in function on update CURRENT_TIMESTAMP which shows this format 0000-00-00 00:00:00.



          Also inside of mysql queries yo may use it the reverse way like UPDATE user SET logouttime = FROM_UNIXTIME(UNIX_TIMESTAMP(logintime)+3600) WHERE user_id = 12345;



          Hope this helps.






          share|improve this answer
























          • Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

            – JMB
            Jan 10 '17 at 8:49











          • Because a Unix timestamp is different than a SQL database timestamp.

            – ypercubeᵀᴹ
            Mar 31 '18 at 21:28
















          0














          If you need to calculate with the timestamp field, you simply may use SELECT UNIX_TIMESTAMP(yourtimestampfield);. I decided to use this instead of the int(11) because of the built in function on update CURRENT_TIMESTAMP which shows this format 0000-00-00 00:00:00.



          Also inside of mysql queries yo may use it the reverse way like UPDATE user SET logouttime = FROM_UNIXTIME(UNIX_TIMESTAMP(logintime)+3600) WHERE user_id = 12345;



          Hope this helps.






          share|improve this answer
























          • Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

            – JMB
            Jan 10 '17 at 8:49











          • Because a Unix timestamp is different than a SQL database timestamp.

            – ypercubeᵀᴹ
            Mar 31 '18 at 21:28














          0












          0








          0







          If you need to calculate with the timestamp field, you simply may use SELECT UNIX_TIMESTAMP(yourtimestampfield);. I decided to use this instead of the int(11) because of the built in function on update CURRENT_TIMESTAMP which shows this format 0000-00-00 00:00:00.



          Also inside of mysql queries yo may use it the reverse way like UPDATE user SET logouttime = FROM_UNIXTIME(UNIX_TIMESTAMP(logintime)+3600) WHERE user_id = 12345;



          Hope this helps.






          share|improve this answer













          If you need to calculate with the timestamp field, you simply may use SELECT UNIX_TIMESTAMP(yourtimestampfield);. I decided to use this instead of the int(11) because of the built in function on update CURRENT_TIMESTAMP which shows this format 0000-00-00 00:00:00.



          Also inside of mysql queries yo may use it the reverse way like UPDATE user SET logouttime = FROM_UNIXTIME(UNIX_TIMESTAMP(logintime)+3600) WHERE user_id = 12345;



          Hope this helps.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 9 '17 at 23:18









          ddlabddlab

          1084




          1084













          • Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

            – JMB
            Jan 10 '17 at 8:49











          • Because a Unix timestamp is different than a SQL database timestamp.

            – ypercubeᵀᴹ
            Mar 31 '18 at 21:28



















          • Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

            – JMB
            Jan 10 '17 at 8:49











          • Because a Unix timestamp is different than a SQL database timestamp.

            – ypercubeᵀᴹ
            Mar 31 '18 at 21:28

















          Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

          – JMB
          Jan 10 '17 at 8:49





          Many thanks for help. But why my TIMESTAMP column do not give a TIMESTAMP ? In my mind a TIMESTAMP colum give Timestamp, and a DATETIME column give a DATETIME ?! Very curiuous for me...

          – JMB
          Jan 10 '17 at 8:49













          Because a Unix timestamp is different than a SQL database timestamp.

          – ypercubeᵀᴹ
          Mar 31 '18 at 21:28





          Because a Unix timestamp is different than a SQL database timestamp.

          – ypercubeᵀᴹ
          Mar 31 '18 at 21:28


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f160472%2fphpmyadmin-feed-a-timestamp-column-with-0000-00-00-000000%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Liste der Baudenkmale in Friedland (Mecklenburg)

          Single-Malt-Whisky

          Czorneboh