Re: [PHP] convert numerical day of week

2007-05-25 Thread tedd
What a hoot! When I saw the the number of post to this thread, I figured someone got their shorts in a knot. Only a bunch of geeks could get into this much discussion of what day of the week it is. Aren't we a sad lot? Cheers, tedd -- --- http://sperling.com http://ancientstones.com

Re: [PHP] convert numerical day of week

2007-05-25 Thread Robert Cummings
On Fri, 2007-05-25 at 09:10 -0400, tedd wrote: What a hoot! When I saw the the number of post to this thread, I figured someone got their shorts in a knot. Only a bunch of geeks could get into this much discussion of what day of the week it is. Aren't we a sad lot? Only if we take

Re: [PHP] convert numerical day of week

2007-05-25 Thread Jochem Maas
Robert Cummings wrote: On Fri, 2007-05-25 at 09:10 -0400, tedd wrote: What a hoot! When I saw the the number of post to this thread, I figured someone got their shorts in a knot. Only a bunch of geeks could get into this much discussion of what day of the week it is. Aren't we a sad lot?

Re: [PHP] convert numerical day of week

2007-05-25 Thread Robert Cummings
On Fri, 2007-05-25 at 17:26 +0200, Jochem Maas wrote: Robert Cummings wrote: On Fri, 2007-05-25 at 09:10 -0400, tedd wrote: What a hoot! When I saw the the number of post to this thread, I figured someone got their shorts in a knot. Only a bunch of geeks could get into this much

Re: [PHP] convert numerical day of week

2007-05-24 Thread Richard Lynch
On Tue, May 22, 2007 11:46 am, Bosky, Dave wrote: How can I convert the numerical day of week to the string version? Example, if the day of the week is 1 I would like to print out 'Sunday'. $days = array(1='Sunday', 'Mondy', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); echo

Re: [PHP] convert numerical day of week

2007-05-23 Thread Robin Vickery
On 22/05/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 13:47 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Nothing said it was important, but why implement a half-assed solution when you can implement a superior solution in as much time?

Re: [PHP] convert numerical day of week

2007-05-23 Thread Robert Cummings
On Wed, 2007-05-23 at 10:31 +0300, Robin Vickery wrote: On 22/05/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 13:47 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Nothing said it was important, but why implement a half-assed solution

Re: [PHP] convert numerical day of week

2007-05-23 Thread Greg Donald
On 5/23/07, Robin Vickery [EMAIL PROTECTED] wrote: they're all bloated: print jddayofweek($day_number, 1); Must go --enable-calendar now :) -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] convert numerical day of week

2007-05-23 Thread Robert Cummings
On Wed, 2007-05-23 at 09:23 -0500, Greg Donald wrote: On 5/23/07, Robin Vickery [EMAIL PROTECTED] wrote: they're all bloated: print jddayofweek($day_number, 1); Must go --enable-calendar now :) Awww, I didn't notice it's a compile flag... hmmm, not so portable that way. Something tells

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
Do you mean by using the date() function? On 5/22/07, Bosky, Dave [EMAIL PROTECTED] wrote: How can I convert the numerical day of week to the string version? Example, if the day of the week is 1 I would like to print out 'Sunday'. Thanks, Dave

Re: [PHP] convert numerical day of week

2007-05-22 Thread Richard Davey
Hi Dave, Tuesday, May 22, 2007, 5:46:38 PM, you wrote: How can I convert the numerical day of week to the string version? Example, if the day of the week is 1 I would like to print out 'Sunday'. $days = array(1 = 'Sunday', 2 = 'Monday', 3 = 'Tuesday', etc ...); then just $today = $days[1];

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Bosky, Dave [EMAIL PROTECTED] wrote: How can I convert the numerical day of week to the string version? Example, if the day of the week is 1 I would like to print out 'Sunday'. $days = array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ); $day =

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
:[EMAIL PROTECTED] *Sent:* Tuesday, May 22, 2007 12:50 PM *To:* Bosky, Dave *Cc:* php-general@lists.php.net *Subject:* Re: [PHP] convert numerical day of week Do you mean by using the date() function? On 5/22/07, *Bosky, Dave* [EMAIL PROTECTED] wrote: How can I convert the numerical day

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Daniel Brown [EMAIL PROTECTED] wrote: ? function num2day($num) { if($num == 1) { $day = Sunday; } elseif($num == 2) { $day = Monday; } elseif($num == 3) { $day = Tuesday; } elseif($num == 4) { $day = Wednesday; } elseif($num == 5) {

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
On 5/22/07, Greg Donald [EMAIL PROTECTED] wrote: On 5/22/07, Daniel Brown [EMAIL PROTECTED] wrote: ? function num2day($num) { if($num == 1) { $day = Sunday; } elseif($num == 2) { $day = Monday; } elseif($num == 3) { $day = Tuesday; } elseif($num

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 12:46 -0400, Bosky, Dave wrote: How can I convert the numerical day of week to the string version? Example, if the day of the week is 1 I would like to print out 'Sunday'. I saw a bunch of bad examples given to you that completely ignore any available locale

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: I saw a bunch of bad examples given to you that completely ignore any available locale information... so here's a better version: I seem to have missed the part of the question where it said considering locale was important. -- Greg Donald

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 12:58 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: I saw a bunch of bad examples given to you that completely ignore any available locale information... so here's a better version: I seem to have missed the part of the question where

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 12:58 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: I saw a bunch of bad examples given to you that completely ignore any available locale information... so here's a better version:

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Nothing said it was important, but why implement a half-assed solution when you can implement a superior solution in as much time? Your solution contains overhead you don't even know you need. Coding for locales is an edge case since most

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 14:32 -0400, Daniel Brown wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-05-22 at 12:58 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: I saw a bunch of bad examples given to you that completely ignore any

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 13:47 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Nothing said it was important, but why implement a half-assed solution when you can implement a superior solution in as much time? Your solution contains overhead you don't even know

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
:: yawns :: After all the bickering, I wouldn't be surprised if the OP never asks a question here again. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 15:00 -0400, Daniel Brown wrote: :: yawns :: After all the bickering, I wouldn't be surprised if the OP never asks a question here again. Who's bickering? When did a simple discussion become bickering? Maybe you should take a nap... you're obviously tired.

Re: [PHP] convert numerical day of week

2007-05-22 Thread Daniel Brown
You amuse me, but it's not worth getting into a discussion over. Enjoy the rest of your day! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: No, your solution is bloated. Mine may run a tad slower, Two function calls wrapped in a function will be slower. Tad or a lot, slower is still slower. but it consumes less memory since it uses the weekday names already defined in the

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 17:13 -0500, Greg Donald wrote: My solution stands as the best one, for memory usage and speed. Please benchmark it so you will learn from this experience. Yours is the least maintainable. I have nothing to learn from you that I didn't learn in kindergarten. Cheers,

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Yours is the least maintainable. Hehe.. with 4 times as many lines of code and 160% more bytes of code overall? cat locale.php|grep -v ^$|wc -l 16 cat simple.php|grep -v ^$|wc -l 4 ls -lavh -rw-r--r--1 destiney

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 17:54 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Yours is the least maintainable. Hehe.. with 4 times as many lines of code and 160% more bytes of code overall? cat locale.php|grep -v ^$|wc -l 16 cat simple.php|grep

Re: [PHP] convert numerical day of week

2007-05-22 Thread Greg Donald
On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: They didn't teach PHP where I attended kindergarten. Is that a Canadian thing? Exactly, and I'm not about to learn PHP from you now *lol*. Next time you should say so up front, I would have spotted you 10% on the benchmarks. -- Greg

Re: [PHP] convert numerical day of week

2007-05-22 Thread Tom Rogers
Hi, Wednesday, May 23, 2007, 2:46:38 AM, you wrote: BD How can I convert the numerical day of week to the string version? BD Example, if the day of the week is 1 I would like to print out 'Sunday'. BD BD Thanks, BD Dave ?php $day =2; //for a Monday start echo gmdate('l',($day + 3) * 24 *

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 19:17 -0500, Greg Donald wrote: On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: They didn't teach PHP where I attended kindergarten. Is that a Canadian thing? Exactly, and I'm not about to learn PHP from you now *lol*. Next time you should say so up

Re: [PHP] convert numerical day of week

2007-05-22 Thread tg-php
Mom! Dad! Stop fighting! = = = Original message = = = On 5/22/07, Robert Cummings [EMAIL PROTECTED] wrote: Yours is the least maintainable. Hehe.. with 4 times as many lines of code and 160% more bytes of code overall? cat locale.php|grep -v ^$|wc -l 16 cat simple.php|grep -v

Re: [PHP] convert numerical day of week

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 21:13 -0400, [EMAIL PROTECTED] wrote: Mom! Dad! Stop fighting! In case anyone is wondering... I'm the Dad!! :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com |

Re: [PHP] convert numerical day of week

2007-05-22 Thread Davi
Em Terça 22 Maio 2007 22:39, Robert Cummings escreveu: On Tue, 2007-05-22 at 21:13 -0400, [EMAIL PROTECTED] wrote: Mom! Dad! Stop fighting! In case anyone is wondering... I'm the Dad!! :) Just read my sig... =) Time to sleep... Good bye! =) -- Davi Vidal [EMAIL PROTECTED] [EMAIL