Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Display the date in readable format from UNIX timestamp.

phpMyEdit Configuration     Display the date in readable format from UNIX timestamp.
Odoslať novú tému   Odpovedať na tému    
 
MediaHound     Založený: 16.12.2007   Príspevky: 2  
Príspevok Zaslal: 2007-12-16 05:53
Návrat hore  Odpovedať s citátom     

I spent a bit of time to figure this out reading several posts here, figured I would post the bit of code I use to display the date. My database has the date stored in the UNIX timestamp format, you know, like "1187121112" - something I personally cannot interpret when I see :)
Hopefully this saves somebody some time :)
Kód:

$opts['fdd']['date'] = array(
// added the two following lines to overwrite the unix timestamp with something comprehensible...
  'sql'  => 'FROM_UNIXTIME(date)',
  'datemask' => 'D M j, Y g:i A',
  'name'     => 'Date',
  'select'   => 'T',
  'maxlen'   => 64,
  'default'  => '0',
  'sort'     => true
);


Basically, my installation, I had to add these two lines:
Kód:
  'sql'  => 'FROM_UNIXTIME(date)',
  'datemask' => 'D M j, Y g:i A',


To edit the way the date shows up, day, month, year, time AM/PM, that sort of thing, head on over to:
http://php.net/date
Find the letters and such you want for your installation, and edit this bit:
Kód:
'D M j, Y g:i A'


Cheers!

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov