/ Published in: PHP
you can specify the source date format with the third parameter
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// name: evDateToSQL // version: v0.1 // description: devuelve un string para sql function evDateToSQL( $date, $separator = '/', $lang = null ) { switch ( $lang ) : case 'es' : $dateConv = $dateTemp[2] . '-' . $dateTemp[1] . '-' . $dateTemp[0]; break default : $dateConv = $dateTemp[2] . '-' . $dateTemp[0] . '-' . $dateTemp[1]; break endswitch; return $dateConv; }