Re: [PHP] strtotime problem

2008-10-10 Thread Thodoris Goltsios
Greetings, Thodoris. In reply to Your message dated Wednesday, October 8, 2008, 16:35:40, Greetings to you too :-) . From your function name I assume you want to use it in MySQL. In that case, why don't you have MySQL do all the magic for you? eg. INSERT INTO table (col) VALUES

Re: [PHP] strtotime problem

2008-10-08 Thread Thodoris
On Oct 8, 2008, at 7:08 AM, Thodoris wrote: I know that *strtotime*() only recognises the formats mm/dd/, -mm-dd and mmdd for numeric months but I need do something like that: function dateWebToMysql($webdate){ $format = 'Y-m-d'; $timestamp = strtotime($webdate);

Re: [PHP] strtotime problem

2008-10-08 Thread Stut
On 8 Oct 2008, at 12:58, Thodoris wrote: Actually this means that strtotime() was made with Americans *only* in mind... :-) . As far as I know it uses the configured timezone to decide between ambiguous formats. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] strtotime problem

2008-10-08 Thread Jason Pruim
On Oct 8, 2008, at 7:58 AM, Thodoris wrote: Actually strtotime accepts all kinds of things... Last week Thursday midnight for example works perfectly. You could do an explode on the field and then reorder the array anyway that you want... ?PHP $date = 13/01/2008; $datearray =

Re: [PHP] strtotime problem

2008-10-08 Thread Maciek Sokolewicz
Thodoris wrote: Actually strtotime accepts all kinds of things... Last week Thursday midnight for example works perfectly. You could do an explode on the field and then reorder the array anyway that you want... ?PHP $date = 13/01/2008; $datearray = explode(/, $date); echo

Re: [PHP] strtotime problem

2008-10-08 Thread Thodoris
From your function name I assume you want to use it in MySQL. In that case, why don't you have MySQL do all the magic for you? eg. INSERT INTO table (col) VALUES (FROM_UNIXTIME($timestamp)); (using FROM_UNIXTIME($timestamp) will give you the date-time in mysql format (-MM-DD HH:MM:SS)

Re: [PHP] strtotime problem

2008-10-08 Thread Thodoris
Actually strtotime accepts all kinds of things... Last week Thursday midnight for example works perfectly. You could do an explode on the field and then reorder the array anyway that you want... ?PHP $date = 13/01/2008; $datearray = explode(/, $date); echo $datearray[1] ./.

Re: [PHP] strtotime problem

2008-10-08 Thread Jason Pruim
On Oct 8, 2008, at 7:08 AM, Thodoris wrote: I know that *strtotime*() only recognises the formats mm/dd/, -mm-dd and mmdd for numeric months but I need do something like that: function dateWebToMysql($webdate){ $format = 'Y-m-d'; $timestamp =

Re: [PHP] strtotime problem

2008-10-08 Thread Jason Pruim
On Oct 8, 2008, at 7:24 AM, Thodoris wrote: On Oct 8, 2008, at 7:08 AM, Thodoris wrote: I know that *strtotime*() only recognises the formats mm/dd/, -mm-dd and mmdd for numeric months but I need do something like that: function dateWebToMysql($webdate){ $format =

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 13:40, toni baker wrote: $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output: Fri Oct 11 2002

Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil
toni, $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output: Fri Oct 11 2002 Mon Feb 4 2002 Wed Dec 31 1969 Is

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 14:11, DL Neil wrote: toni, $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output:

Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil
Torben, toni, $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output: Fri Oct 11 2002 Mon Feb 4

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 15:05, DL Neil wrote: Torben, No offense, but in TFM (which you have of course R), follow the 'Date Input Formats' link to: http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html You will find this sentence: The construct 'month/day/year', popular

Re: [PHP] strtotime problem

2002-02-04 Thread DL Neil
Torben, No offense, but in TFM (which you have of course R), follow the 'Date Input Formats' link to: http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html You will find this sentence: The construct 'month/day/year', popular in the United States, is