[PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Paul Nowosielski
Dear All, I was wondering if there are any major date function changes between php4 and 5. When I say date function I mean mktime() , date() ,strtotime() etc. Here is my dilemma, I've upgraded from php4 to php5. there is some very old legacy code that is not working correctly. Specifically

Re: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Chris
Paul Nowosielski wrote: Dear All, I was wondering if there are any major date function changes between php4 and 5. I don't think so but check the docs: http://www.php.net/manual/en/faq.migration5.php When I say date function I mean mktime() , date() ,strtotime() etc. Here is my dilemma,

RE: [PHP] Date functions differences between php 4 and 5

2007-03-22 Thread Jake McHenry
:18 PM To: Paul Nowosielski Cc: php-general@lists.php.net Subject: Re: [PHP] Date functions differences between php 4 and 5 Paul Nowosielski wrote: Dear All, I was wondering if there are any major date function changes between php4 and 5. I don't think so but check the docs

[PHP] mysql/php date functions..

2005-09-26 Thread bruce
hi... can anybody point me to a good/basic tutorial (tested) for php/mysql date functions... basically, i want to store a date/time in a column, and be able to read it, manipulate it, and update the table. i've seen various articles/sample code, but i'm looking for something that i cna pretty

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Jim Moseby
-Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:12 AM To: php-general@lists.php.net Subject: [PHP] mysql/php date functions.. hi... can anybody point me to a good/basic tutorial (tested) for php/mysql date functions... basically

Re: [PHP] mysql/php date functions..

2005-09-26 Thread Silvio Porcellana
Jim Moseby wrote: Hi Bruce! MySQL and PHP both have extensive built-in date functions that are clearly documented and extraordinarily easy to use. For the vast majority of situations, there is no need to manually write any custom date-handling code. The decision to use MySQL or PHP to

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
-Original Message- From: Silvio Porcellana [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 8:51 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. Jim Moseby wrote: Hi Bruce! MySQL and PHP both have extensive built-in date functions that are clearly

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: how can i create a mysql sql statement to insert a php 'time()' into mysql? i've got the mysql var 't1, timestamp' but i can't figure out how to do an insert $q = time(); $sql = sprintf(insert into foo (id, ctime) values(%d, %???), $id, $q); can't figure out how to get this to

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
), it doesn't work... if i -- insert into foo (id, time) values (2, NOW()), it works!!... my question is why??? -bruce -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:00 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
, September 26, 2005 11:00 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. bruce wrote: how can i create a mysql sql statement to insert a php 'time()' into mysql? i've got the mysql var 't1, timestamp' but i can't figure out how to do an insert $q = time

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chris W. Parker
bruce mailto:[EMAIL PROTECTED] on Monday, September 26, 2005 11:13 AM said: i'm concerned that i can't seem to craft/create a basic sql cmd within mysql to get a value (other than NOW()) to work... [snip] my question is why??? MySQL timestamps are different from UNIX timestamps. Chris.

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: thanks... but that's not it john... i'm not worried about creating the sql_statement in the php... i'm concerned that i can't seem to craft/create a basic sql cmd within mysql to get a value (other than NOW()) to work... if i do (from mysql) -- insert into foo (id, time) values

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
but that still doesn't explain why i can't slam some value directly into the timestamp var within the mysql tbl... -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:15 AM To: php-general@lists.php.net Subject: RE: [PHP] mysql/php date

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my question also comes down to .. do i use the php date functions for date/time manipulation.. or do i use the mysql functions any thoughts/suggestions... -bruce

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my question also comes down to .. do i use the php date functions for date/time manipulation.. or do i use the mysql functions any thoughts/suggestions

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Jim Moseby
-Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 2:46 PM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. john... that appears to be it!! although i would have assumes it would have done

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 11:48 AM To: php-general@lists.php.net Subject: Re: [PHP] mysql/php date functions.. bruce wrote: john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my

RE: [PHP] mysql/php date functions..

2005-09-26 Thread bruce
bruce -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 12:38 PM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. so you play with the time/date vars on the php side, and then simply store them in the mysql tbl

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
bruce wrote: or.. better yet. if i do a php - time(), i get a unix_timestamp var. how do you guys store this in mysql. you can't simply do an insert into a mysql/timestamp var. so how do you convert it? I don't convert it. I store the UNIX timestamp in an INT(11) column. also, once you

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chris W. Parker
John Nichel mailto:[EMAIL PROTECTED] on Monday, September 26, 2005 12:43 PM said: I don't convert it. I store the UNIX timestamp in an INT(11) column. This is going to be a basic question I'm sure but why INT and not VARCHAR? Is it simply because a timestamp is a number? Chris. -- PHP

Re: [PHP] mysql/php date functions..

2005-09-26 Thread Kristen G. Thorson
- the php var? thanks bruce -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Monday, September 26, 2005 12:38 PM To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. so you play with the time/date vars on the php side, and then simply

Re: [PHP] mysql/php date functions..

2005-09-26 Thread John Nichel
Chris W. Parker wrote: John Nichel mailto:[EMAIL PROTECTED] on Monday, September 26, 2005 12:43 PM said: I don't convert it. I store the UNIX timestamp in an INT(11) column. This is going to be a basic question I'm sure but why INT and not VARCHAR? Is it simply because a timestamp is

RE: [PHP] mysql/php date functions..

2005-09-26 Thread Chrome
] Sent: 26 September 2005 19:46 To: 'John Nichel'; php-general@lists.php.net Subject: RE: [PHP] mysql/php date functions.. john... that appears to be it!! although i would have assumes it would have done a most significant bit fill with 0's... so my question also comes down to .. do i use the php

[PHP] mysql/php date functions..

2005-09-26 Thread info
Hello Bruce, While the date functions are well documented - http://php.net/date - here is a little example to manipulate the date with php, rather than mysql: // set the new expiry date // DATE FUNCTIONS FOR THE EXPIRY MODULE // first perform date arithmetic $listingExpiry = mktime

[PHP] date functions

2004-02-24 Thread Matthew Oatham
Hi, You might already be fed up with my posts but I'm a complete PHP newbie and find these groups are the best way to learn! Anyway I have the database date in the format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when in some situations I only want to show the user the date in the

RE: [PHP] date functions

2004-02-24 Thread Pablo Gosse
snip You might already be fed up with my posts but I'm a complete PHP newbie and find these groups are the best way to learn! Anyway I have the database date in the format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when in some situations I only want to show the user the date in the format

RE: [PHP] date functions

2004-02-24 Thread Sam Masiello
Depending on your database engine (which you didn't mention in your post), some allow you to format the date however you want it as you pull it out of the database in your sql query. I always find this to be the easiest way to do it. That way you don't have to worry about formatting the data

Re: [PHP] date functions

2004-02-24 Thread Adam Bregenzer
On Tue, 2004-02-24 at 13:29, Matthew Oatham wrote: You might already be fed up with my posts but I'm a complete PHP newbie and find these groups are the best way to learn! Anyway I have the database date in the format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when in some situations I

[PHP] date functions

2002-09-23 Thread Patrick
i got 2 dates and i want to know how many minutes between em,, like: $date1 = date(Y-m-j H:i); $date2 = date(Y-m-j H:i, strtotime(now) + 1800); $minutes = date_something($date1, $date2); echo there are $minutes between, $date1 and $date2; regards patrick -- PHP General Mailing List

Re: [PHP] date functions

2002-09-23 Thread Support @ Fourthrealm.com
Patrick Off the top of my head... Convert both date1 and date2 to unix timestamps, and subtract one from the other. That will give you the number of seconds between them. Then, convert to hours, minutes, etc as required. Peter At 10:38 PM 9/23/2002 +0200, Patrick wrote: i got 2 dates and

Fw: [PHP] date functions

2002-09-23 Thread Kevin Stone
You should be working with UNIX timestamps here. Convert the dates to human readble only after you've done the calcuations. -Kevin - Original Message - From: Patrick [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 23, 2002 2:38 PM Subject: [PHP] date functions i got

[PHP] Date functions Unic Epoch

2002-06-09 Thread Juan Antonio Ruiz Zwollo
Hi! Say, has anybody re-written the date funtions so they work with any date and not be crippled by the unix timestamp range limit? I am looking for a function which will do the equivalent of date(w,mktime(0,0,0,8,30,1934)) but that will actually *work*. Does anybody know a way to return

[PHP] date functions

2002-05-18 Thread Josh Edwards
Does anyone know a good way to count the days between two dates. ie how many Mondays fall between two dates. As a starting point I have calculated the start and end dates and the no of days b/w them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] date functions

2002-05-18 Thread Richard Baskett
of. You will never live if you are looking for the meaning of life. - Albert Camus From: Josh Edwards [EMAIL PROTECTED] Date: Sun, 19 May 2002 10:22:28 +1000 To: [EMAIL PROTECTED] Subject: [PHP] date functions Does anyone know a good way to count the days between two dates. ie how many

Re: [PHP] date functions

2002-05-18 Thread Tom Rogers
Hi I think this works :) ? $date1 = 1/1/2002; $date2 = date(m/d/Y); $time1 = strtotime($date1); $time2 = strtotime($date2); //get the first monday after date1 $first_monday = strtotime(first monday,$time1); //check if its within date2 if($first_monday $time2): //set count to 0 as we

Re: [PHP] date functions

2002-05-18 Thread Miguel Cruz
On Sun, 19 May 2002, Josh Edwards wrote: Does anyone know a good way to count the days between two dates. ie how many Mondays fall between two dates. As a starting point I have calculated the start and end dates and the no of days b/w them. Pretty much common sense, right? How about

[PHP] Date Functions

2001-08-20 Thread Peter Allum
I am using PHP 4, I have a date which I am adding to a MYSQL db, I have that bit sorted, I am trying to calculate an 2 expiry dates, one that is 1 year and 11 months ahead of the 1st date and another that is 2 years ahead of the 1st date. Any Ideas, I have seen lots of scripts for adding days

Re: [PHP] Date Functions

2001-08-20 Thread Renze Munnik
On Mon, Aug 20, 2001 at 12:12:15PM +0100, Peter Allum wrote: I am using PHP 4, I have a date which I am adding to a MYSQL db, I have that bit sorted, I am trying to calculate an 2 expiry dates, one that is 1 year and 11 months ahead of the 1st date and another that is 2 years ahead of the 1st