Re: [PHP-DB] Help with date....

2003-01-07 Thread Ignatius Reilly
You can do it very nicely with MySQL:

$query = SELECT WEEKDAY( '{$mydate}' ) ;
Provided your date is correctly formatted ( -mm-dd )

Ignatius

- Original Message -
From: Rodrigo Corrêa [EMAIL PROTECTED]
To: PHP1 [EMAIL PROTECTED]
Sent: Tuesday, January 07, 2003 3:57 PM
Subject: [PHP-DB] Help with date


How can i find out the day of the week in one date??

like  =  07/01/2002   the day of the week is  3  thurday

like  = 18/01/2002 the day of the week is  6  saturday

is there a way to do that?



Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED]





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Help with date....

2003-01-07 Thread SELPH,JASON (HP-Richardson,ex1)
with mysql its:
WEEKDAY(date)
Returns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =
Sunday):

mysql SELECT WEEKDAY('1998-02-03 22:23:00');
- 1
mysql SELECT WEEKDAY('1997-11-05');
- 2
http://www.mysql.com/doc/en/Date_and_time_functions.html


in php its:
string date ( string format [, int timestamp])
and  w - day of the week, numeric, i.e. 0 (Sunday) to 6 (Saturday)
http://www.php.net/manual/en/function.date.php


Not sure which you wanted since this is the php-db group :)
Cheers
Jason


-Original Message-
From: Rodrigo Corrêa [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 8:58 AM
To: PHP1
Subject: [PHP-DB] Help with date


How can i find out the day of the week in one date??

like  =  07/01/2002   the day of the week is  3  thurday

like  = 18/01/2002 the day of the week is  6  saturday

is there a way to do that?



Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Help with date

2002-11-28 Thread Aaron Wolski
Well...

1 day = 60*60*24 = 86400

You figure it out from there :)

Just one example.

Aaron

-Original Message-
From: Dankshit [mailto:[EMAIL PROTECTED]] 
Sent: November 28, 2002 12:06 PM
To: PHP; PHP1
Subject: [PHP-DB] Help with date


How can i add days to a date??




Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Help with date

2002-11-28 Thread Ignatius Reilly
If you use MySQL:

SELECT DATE_ADD( $my_date, INTERVAL n DAY ) AS new_date ;

Ignatius

- Original Message -
From: Dankshit [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]; PHP1 [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 6:06 PM
Subject: [PHP-DB] Help with date



How can i add days to a date??




Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED]





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Help with Date

2002-11-21 Thread DL Neil
Rodrigo,

Is there a way to convert a date  20/11/2002  to a Float number in PHP,
since the date starts in 30/12/1899, just like the delphi treats the
dates

=Check out UNIX timestamps (but watch the valid date range),
=dn


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Help with Date

2002-11-21 Thread John W. Holmes
 Is there a way to convert a date  20/11/2002  to a Float number in
PHP,
 since the date starts in 30/12/1899, just like the delphi treats the
 dates

Yeah, of course. To convert 20/11/2002 into a float, just do

echo (float)20/11/2002;

and you get 20!!

Or you can use strtotime() to convert it to a Unix timestamp (integer,
number of seconds since Jan 1, 1970).

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php