Don't understand date format in mysql like 1286066935 - UserCake

I use UserCakefor UserManagement - userCake_Usersthere is a column in the table LastSignIn, but the value is in this format: 1286066935

with this function i get the correct date

public function updateLastSignIn()
{
    global $db,$db_table_prefix;

    $sql = "UPDATE ".$db_table_prefix."Users
            SET
            LastSignIn = '".time()."'
            WHERE
            User_ID = '".$db->sql_escape($this->user_id)."'";

    return ($db->sql_query($sql));
}

but what format is 1286066935?

this is sql file

--
-- Table structure for table `Users`
--

CREATE TABLE IF NOT EXISTS `Users` (
  `User_ID` int(11) NOT NULL auto_increment,
  `Username` varchar(150) NOT NULL,
  `Username_Clean` varchar(150) NOT NULL,
  `Password` varchar(225) NOT NULL,
  `Email` varchar(150) NOT NULL,
  `ActivationToken` varchar(225) NOT NULL,
  `LastActivationRequest` int(11) NOT NULL,
  `LostPasswordRequest` int(1) NOT NULL default '0',
  `Active` int(1) NOT NULL,
  `Group_ID` int(11) NOT NULL,
  `SignUpDate` int(11) NOT NULL,
  `LastSignIn` int(11) NOT NULL,
  PRIMARY KEY  (`User_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
+3
source share
6 answers

I assume this is a UNIX timestamp .

+3
source

but what format is 1286066935?

This is Unix time . This is the number of seconds since midnight GMT January 1, 1970.

1286066935 represents 00:48:55 GMT today, October 3, 2010.

Unix "" /, -, . date Linux:

$ date -d @1286066935
Sun Oct  3 01:48:55 BST 2010
+2
+2

UNIX time: http://en.wikipedia.org/wiki/Unix_time

() php ( , , ) , .

+1

UNIX ( 1 1970 .)

, PHP , time(), UNIX .

MySQL-, UNIX_TIMESTAMP().

+1

Possibly UNIX time. The number of seconds since 01/01/1970.

0
source

Source: https://habr.com/ru/post/1767764/


All Articles