Current location: Hot Scripts Forums » Programming Languages » PHP » wierd date() issue


wierd date() issue

Reply
  #1 (permalink)  
Old 08-13-07, 05:11 PM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
wierd date() issue

hi there,

got this little stupid date issue..

this lines of php set the date in my script:
PHP Code:

$day date("h m Y");

    
$time date("H i");
    
$date "$day / $time"
somehow it comes out with the date off august 11th..
for me it is august 13th...
I'm wondering why this is happening...

thnx!

_j
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-13-07, 05:12 PM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
never mind... h is for hours instead of day..

stupid!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-13-07, 05:22 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
It took you less than one minute to figure that out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-14-07, 02:46 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
it sure did... after 15 min of searching I think: let's post it..

when I read my own post after submitting it I saw right away...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-14-07, 03:18 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
Hehe, oh well.

Maybe we can still make this thread useful in some way. Not sure if you knew, but you could achieve the same with one function call:

PHP Code:

$date date("d m Y / H i"); 

You can use pretty much any character in the date() function, just be careful when you're using characters that represent a date format. Then you have to escape it with a backslash.


PHP Code:

$date date("\T\o\d\a\y \i\s: d m Y / H i"); 

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-15-07, 07:56 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
cool.. didn't knew that...


thnx for making this silly post usefull..!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 08-15-07, 08:47 AM
n3wb!e's Avatar
n3wb!e n3wb!e is offline
Wannabe Coder
 
Join Date: Mar 2006
Posts: 216
Thanks: 2
Thanked 0 Times in 0 Posts
thanks ! i didnt know that either.
__________________
i am still a learner and i like $this-> smilie!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 08-15-07, 09:52 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
see how usefull it is
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
date format mysql and php Deansatch PHP 9 03-28-08 05:06 AM
converting date-string to Date object UnrealEd Everything Java 4 05-15-07 07:20 PM
js date franches JavaScript 1 11-25-04 09:42 AM
Date andyX PHP 2 09-20-04 02:37 PM
Problem with date and form djavet PHP 3 05-02-04 01:37 AM


All times are GMT -5. The time now is 08:32 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.