Time
Time
Padarau sql column "time" su type INT. Kuomet serveris man grazina tam tikra laika, gaunu mazdaug toki 1358680594. Cia kaip suprantu yra unix time, taciau kaip man ji paverst i normalu laika, kad rodytu menesi, diena ir valandas:minutes:sekundes ?
Re: Time
Turiu koda
Tai kurioj cia man vietoj irasyt ta
Kad $row['time'] atvaizduotu normalu laika, o ne 1358682532 ?
Code: Select all
<?php// Make a MySQL Connectionmysql_connect("localhost", "log", "pw") or die(mysql_error());mysql_select_db("db") or die(mysql_error()); // Get all the data from the "example" table$result = mysql_query("SELECT * FROM log_connect") or die(mysql_error()); date_default_timezone_set('UTC');echo "<table border='1'>";echo "<tr> <th>IP</th> <th>Nick</th> <th>Time</th> </tr>";// keeps getting the next row until there are no more to getwhile($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['ip']; echo "</td><td>"; echo $row['nick']; echo "</td><td>"; echo $row['time']; echo "</td></tr>";} echo "</table>";?>
Code: Select all
echo date('l jS \of F Y h:i:s A');
- aaarnas
- Vyr. diskusijų administratorius
- Posts: 3891
- Joined: 2010 Aug 31 13:21
- Skype: fiarno
- Contact:
Re: Time
Code: Select all
echo $row['time'];
Code: Select all
echo date('l jS \of F Y h:i:s A', $row['time']);
Palikau CS pasaulį ;/ . Nebepasiekiamas.
Who is online
Users browsing this forum: No registered users and 1 guest