• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] MySQL date manipulation

#3
[eluser]ELRafael[/eluser]
I use TIMESTAMP, for "short" dates (only works 1970 forward)

TIMESTAMP gives me a integer, so i can work easier with it. (add a day, month, hour(s))

and doppo, i still use the date() php function!

Code:
$sql = "SELECT UNIX_TIMESTAMP(datefield) as datefield, * FROM table";

echo date('d/m/Y', $row_returned->datefield);

Of course, birthday date will not work!


Messages In This Thread
[solved] MySQL date manipulation - by El Forum - 10-18-2007, 08:11 AM
[solved] MySQL date manipulation - by El Forum - 10-18-2007, 09:33 AM
[solved] MySQL date manipulation - by El Forum - 10-18-2007, 01:04 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.