date("w", "1/11/2002") = 4?????? 
Author Message
 date("w", "1/11/2002") = 4??????

date("w", "1/11/2002") = 4

Why is this four?
the manual says
w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)

the first day according to me was a friday
friday = 5th day of the week!

ps: php 4.0.6 (if it does matter)



Wed, 27 Apr 2005 02:33:07 GMT  
 date("w", "1/11/2002") = 4??????

Quote:

> date("w", "1/11/2002") = 4

> Why is this four?

date() operates on unixtime, not the human readable format you used. Try
date('w', strtotime('1/11/2002'));

HTH, Jo



Wed, 27 Apr 2005 03:35:25 GMT  
 date("w", "1/11/2002") = 4??????
"Twopeak" wrote

Quote:
> date("w", "1/11/2002") = 4

> Why is this four?
..
> the first day according to me was a friday

What "first day"? Why wouldn't your date be January 11th (which is a Friday as
well...).

Anyway: print the year and you'll see PHP thinks it is 1970 -- and January 1st
1970 was a Thursday. In other words: PHP does not like your date; the second
parameter of date(..) should not be a string value.

a.



Wed, 27 Apr 2005 03:46:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

2. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

3. Parsing ""D""?

4. "Fifth", "Forth", zai nar?

5. Ruby "finalize", "__del__"

6. beginners "let"/"random" question

7. ANNOUNCE: new "plus"- and "dash"-patches available for Tcl7.5a2/Tk4.1a2

8. Looking for "stdin", "stdout"

9. learning Pop-11 the "LOGO way": TEACH GSTART

10. Hi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "Two") text1.sub!("@BLAH", "Two") print text0,"\n" print text1,"\n" produces thiHi, this code: text0 = "One $BLAH Three" text1 = "One @BLAH Three" text0.sub!("$BLAH", "T

11. Match "ab" in "abc", but not in "abd"

12. replace string AFTER "size","initial", "next"

 

 
Powered by phpBB® Forum Software