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 (FROM_UNI

Re[2]: [PHP] strtotime problem

2008-10-10 Thread ANR Daemon
Greetings, Thodoris. In reply to Your message dated Wednesday, October 8, 2008, 16:35:40, >> 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)); >> (usi

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 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... Or something like that :) That wasn't tested but should give you an idea

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... Or something like that :) That wasn't te

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 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... Or something like that :) That wasn't tested but should give you an idea... php.net/expl

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 = strtotime($webda

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 = 'Y

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);

[PHP] strtotime problem

2008-10-08 Thread Thodoris
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); return date($format,$timestamp);

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

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

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.""; > > > print $date2.""; > > > print $date3.""; > > > > > > The code above gives me the following outp

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.""; > > print $date2.""; > > print $date3.""; > > > > The code above gives me

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.""; > print $date2.""; > print $date3.""; > > The code above gives me the following output: > > Fri Oct 11 2002 > Mon Feb 4 2002 > Wed

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.""; > print $date2.""; > print $date3.""; > > The code above gives me the following output: >

[PHP] strtotime problem

2002-02-04 Thread toni baker
$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.""; print $date2.""; print $date3.""; The code above gives me the following output: Fri Oct 11 2002 Mon Feb 4 2002 Wed Dec 31 1969 Is the strtotime()

[PHP] strtotime problem running PHP as Apache module

2001-02-12 Thread Charles Mulford
Can anyone help? Platform: Win2k, Apache, mysql I am causing crashes when trying to run this date stuff using the PHP module, but it works fine when using the same setup using the CGI version. begin code snip $max_date = 90; $ini_date = 0; echo("\t \n");