[PHP] Re: [PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread DL Neil

Rasmus,

I have held several datetime-related conversations with people recently, and another 
series about 'when'/whether
to use PHP or MySQL functionality.

Here you are, the man of PHP, advising Sander to use MySQL functionality! (and in 
marked contrast to the
(biased) advice one might expect on PHP lists, eg JDEW's reply) I'm grinning at the 
apparent incongruity, but
with no insult to yourself.

Would you care to comment further on when one should consider using SQL commands in 
favor of implementing
identical functionality in PHP (and possibly in some situations, vice-versa)?

Regards,
=dn



- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Sander Peters [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 13 January 2002 19:52
Subject: [PHP-DB] Re: [PHP] convert /mm/dd to mm/dd/, how?


 MySQL has plenty of functions to return dates to you in any format you
 specify.  Please read
 
http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions
 and pay special attention to the DATE_FORMAT() function.

 -Rasmus



 On Sun, 13 Jan 2002, Sander Peters wrote:

  Hello everybody,
 
  convert /mm/dd to mm/dd/, how?
 
  MYSQL does everything in /mm/dd.
  I live in the Netherlands and we are use to the format dd/mm/.
 
  What's the best way to display it as mm/dd/ in a table on a query?
 
  My first idea whas to split the date up in vars in php and then print
  the vars in the way I like it
  Is this a bad idea? Or are there better sollutions?
 
  Thanx in advance for answering!
 
 
 
  --
  Met vriendelijke groet / With Greetings,
 
  Sander Peters
 
 site: http://www.visionnet.nl/
email: mailto:[EMAIL PROTECTED]
  webmail: mailto:[EMAIL PROTECTED]
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread Rasmus Lerdorf

You use the right tool for the job.  MySQL is going to have to format the
date field for the return anyway.  It makes sense to simply tell MySQL
your preferred format instead of having it returned to you in the wrong
format and then you having to apply more gear to get it into the right
one.

-Rasmus

On Sun, 13 Jan 2002, DL Neil wrote:

 Rasmus,

 I have held several datetime-related conversations with people recently, and another 
series about 'when'/whether
 to use PHP or MySQL functionality.

 Here you are, the man of PHP, advising Sander to use MySQL functionality! (and in 
marked contrast to the
 (biased) advice one might expect on PHP lists, eg JDEW's reply) I'm grinning at the 
apparent incongruity, but
 with no insult to yourself.

 Would you care to comment further on when one should consider using SQL commands in 
favor of implementing
 identical functionality in PHP (and possibly in some situations, vice-versa)?

 Regards,
 =dn



 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: Sander Peters [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: 13 January 2002 19:52
 Subject: [PHP-DB] Re: [PHP] convert /mm/dd to mm/dd/, how?


  MySQL has plenty of functions to return dates to you in any format you
  specify.  Please read
  
http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions
  and pay special attention to the DATE_FORMAT() function.
 
  -Rasmus
 
 
 
  On Sun, 13 Jan 2002, Sander Peters wrote:
 
   Hello everybody,
  
   convert /mm/dd to mm/dd/, how?
  
   MYSQL does everything in /mm/dd.
   I live in the Netherlands and we are use to the format dd/mm/.
  
   What's the best way to display it as mm/dd/ in a table on a query?
  
   My first idea whas to split the date up in vars in php and then print
   the vars in the way I like it
   Is this a bad idea? Or are there better sollutions?
  
   Thanx in advance for answering!
  
  
  
   --
   Met vriendelijke groet / With Greetings,
  
   Sander Peters
  
  site: http://www.visionnet.nl/
 email: mailto:[EMAIL PROTECTED]
   webmail: mailto:[EMAIL PROTECTED]
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]