Posted By

gfazioli on 09/23/08


Tagged

php date format


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gfazioli


PHP Plain date format


 / Published in: PHP
 

Format date from yyyy-mm-dd hh:mm:ss TO yyyymmddhhmmss

  1. /**
  2.  * Formatta una data dal formato yyyy-mm-dd hh:mm:ss in yyyymmddhhmmss
  3.  */
  4. function plainDate( $d ) {
  5. $pd = explode(' ', $d);
  6. $dd = explode('-', $pd[0]);
  7. $hp = explode(':', $pd[1]);
  8. return( $dd[0].$dd[1].$dd[2].$hp[0].$hp[1].$hp[2] );
  9. }

Report this snippet  

You need to login to post a comment.