|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi
Ho to read date from HTML form -> How to read $_POST['date']="dd/mm/YYYY" string variable as a date? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> Ho to read date from HTML form ->
> How to read $_POST['date']="dd/mm/YYYY" string variable as a date? If you want a unix timestamp then try investigating strtotime(). -- Richard Heyes +----------------------------------------+ | Access SSH with a Windows mapped drive | | http://www.phpguru.org/sftpdrive | +----------------------------------------+ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
What do you mean read a string as a date, a date object?
Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 thiago.pojda@softpartech.com.br Excelência em Softwares Financeiros -----Mensagem original----- De: Merca, Ansta Ltd [mailto:merca@ansta.co.uk] Enviada em: sexta-feira, 9 de maio de 2008 06:36 Para: php-general@lists.php.net Assunto: [php] quick question Hi Ho to read date from HTML form -> How to read $_POST['date']="dd/mm/YYYY" string variable as a date? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
> Well, when I try date('d/m/y', strtotime($_POST('date')) - it seems
> mixing day and month, I tried setlocale(LC_ALL, 'en_GB'); but it didn't strtotime() returns a unix timestamp (ie number of seconds since 1970ish. Nothing to do with the date object. -- Richard Heyes +----------------------------------------+ | Access SSH with a Windows mapped drive | | http://www.phpguru.org/sftpdrive | +----------------------------------------+ |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>>
>> Well, when I try date('d/m/y', strtotime($_POST('date')) - it seems >> mixing day and month, I tried setlocale(LC_ALL, 'en_GB'); but it >> didn't If you're sure that's the format of the date, this will do it... list($day, $month, $year) = explode('/', $thedate); $thetimestamp = mktime(0, 0, 0, $month, $day, $year); -Stut -- http://stut.net/ |
|
![]() |
| Outils de la discussion | |
|
|