Re: [PHP] Working with Dates

2004-12-02 Thread Richard Lynch
Robert Sossomon wrote: I have this code below that needs to display stuff depending on WHEN it is. I am pretty sure it is something simple I have confused (again) but can't place my finger on it. Anyone see the mistake? ?php $today = date(m-d-y); $early = date(m-d-y,mktime(0, 0, 0, 1,

Re: [PHP] Working with dates

2003-03-17 Thread Erik Price
Brad Harriger wrote: I have two variables, $StartDate and EndDate that contain values read from MySQL Date fields. How can I determine if a value entered by the user is between the two dates? I'm using PHP 4.0.6. if ($user_input $StartDate $user_input $EndDate) { // do

RE: [PHP] Working with dates

2003-03-17 Thread John W. Holmes
I have two variables, $StartDate and EndDate that contain values read from MySQL Date fields. How can I determine if a value entered by the user is between the two dates? I'm using PHP 4.0.6. I think you can take MySQL timestamps directly into strtotime(). If($user strtotime($StartDate)

Re: [PHP] Working with dates

2003-03-17 Thread Joshua Moore-Oliva
Switch to postgres! then you can do SELECT stamp FROM table WHERE stamp BETWEEN timestamp 'today' AND timestamp 'tomorrow'; On March 17, 2003 12:43 pm, Brad Harriger wrote: I have two variables, $StartDate and EndDate that contain values read from MySQL Date fields. How can I determine if

Re: [PHP] Working with dates

2003-03-17 Thread Jim Lucas
you do that same query in mysql Jim - Original Message - From: Joshua Moore-Oliva [EMAIL PROTECTED] To: Brad Harriger [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, March 17, 2003 10:49 AM Subject: Re: [PHP] Working with dates Switch to postgres! then you can do SELECT stamp

Re: [PHP] Working with dates in PHP

2002-10-11 Thread Tom Rogers
Hi, Friday, October 11, 2002, 3:53:55 PM, you wrote: JP I am at my wits end at the moment. I am pulling a datetimestamp out of a JP database and attempting to get the year month and day out of it. However JP I am stumped as how to do it. JP The format is -MM-DD HH:MM:SS and its coming

RE: [PHP] Working with dates in PHP

2002-10-11 Thread David Freeman
I am at my wits end at the moment. I am pulling a datetimestamp out of a database and attempting to get the year month and day out of it. Do it in your sql query. Check out chapter 6 of the MySQL manual for ways to manipulate dates. Eg. $query = select DATE_FORMAT(DTStamp, '%e %b