[PHP] Date problems

2007-01-04 Thread Beauford
Hi All, I have a database with a bunch of dates in it. I want to count the number of entries for each year and then display the year and the count. i.e. YearCount 200622 200518 200414 200322 This is what I have tried but just not quite getting it. $query select count(date)

Re: [PHP] Date problems

2007-01-04 Thread Stut
Beauford wrote: $query select count(date) as count, YEAR(date) as thisyear from stats group ^ = needed here by thisyear; -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Date problems

2007-01-04 Thread Beauford
Yea, I just figured this out. When I cut and pasted I must have overwrote the =. Thanks -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: January 4, 2007 4:27 PM To: Beauford Cc: PHP Subject: Re: [PHP] Date problems Beauford wrote: $query select count(date

Re: [PHP] Date problems

2006-04-09 Thread Satyam
); Satyam - Original Message - From: Mace Eliason [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Sunday, April 09, 2006 4:14 AM Subject: [PHP] Date problems Hi, I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I

Re: [PHP] Date problems

2006-04-09 Thread Rasmus Lerdorf
Satyam wrote: Timestamps are stored as seconds from a certain date. The base date differ depending on the platform, Windows use 1/1/1980 the rest 1/1/1970, but still seconds. 7 days are 7*24*60*60. Just add that much to a timestamp. It helps having a constant such as: define

[PHP] Date problems

2006-04-08 Thread Mace Eliason
Hi, I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work $today = date('m/d/Y'); $nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y))); if I echo the above variables they are the

Re: [PHP] Date problems

2006-04-08 Thread Rasmus Lerdorf
Mace Eliason wrote: Hi, I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work $today = date('m/d/Y'); $nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y))); if I echo the above

Re: [PHP] Date problems

2006-04-08 Thread Rasmus Lerdorf
Rasmus Lerdorf wrote: Mace Eliason wrote: Hi, I am having troubles adding 7 days to the current date. I have been reading through php.net date() and this is what I have come up with but it doesn't work $today = date('m/d/Y'); $nextweek = date('m/d/Y',mktime(date(m), date(d)+7, date(Y)));

[PHP] date problems

2002-02-04 Thread toni baker
$date1 = 12/12/2001; $date1 = date(D M j Y, strtotime($date1)); print $date1.br; When I execute the code above I get the following output: Tue Dec 11 2001 instead Wed Dec !2 2001 Why does this happen and how can I get the Dec 12 output? Thanks

Re: [PHP] date problems

2002-02-04 Thread Jim Lucas [php]
sounds like it might have something to do with leap year. Jim Lucas - Original Message - From: toni baker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 04, 2002 12:03 PM Subject: [PHP] date problems $date1 = 12/12/2001; $date1 = date(D M j Y, strtotime($date1

Re: [PHP] date problems

2002-02-04 Thread Edward van Bilderbeek - Bean IT
PM Subject: [PHP] date problems $date1 = 12/12/2001; $date1 = date(D M j Y, strtotime($date1)); print $date1.br; When I execute the code above I get the following output: Tue Dec 11 2001 instead Wed Dec !2 2001 Why does this happen and how can I get the Dec 12 output? Thanks

[PHP] Date problems

2001-11-02 Thread Raymond C. Rodgers
Hi, I'm having a bit of a weird problem with the date() function. I am using PostgreSQL to store guestbook entries and updating and displaying them with Apache 1.3x and PHP4 on OpenBSD. The date information is being stored correctly in PostgreSQL, but I'm using the date() function to format