Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder UrbanTwitch's Avatar
    Join Date
    Apr 2006
    Posts
    485
    Thanks
    44
    Thanked 1 Time in 1 Post

    Explain PHP dates

    I am not good with PHP Dates. Can someone put this in english:

    PHP Code:
    $check mysql_fetch_array($checkflood);
    $time date("YmdHis");
    $ftime date("YmdHis"time() + 10); 
    This is a anti-spam flood thingy. Does the +10 mean you have to wait 10 seconds before you can post again? (on a comment board)
    Formerly MysticScript

    6+ years club

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    here are the basics of the date and time functions i suggest going to www.php.net to read in more detail,
    PHP Code:
    time(); //return a unix timestamp (number of secs since 1/1/1970)
    time() + 10//would give u a unix timestamp 10secs in the future

    date("YmdHis"time() + 10); //gives you a formated date that is 10 secs in the future 

  • #3
    Regular Coder UrbanTwitch's Avatar
    Join Date
    Apr 2006
    Posts
    485
    Thanks
    44
    Thanked 1 Time in 1 Post
    Well the +10 is not 10 seconds for me. I have to wait longer.
    Formerly MysticScript

    6+ years club

  • #4
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    i wud recommend checking out

    http://uk2.php.net/manual/en/function.time.php
    and...
    http://uk2.php.net/manual/en/function.date.php

    according to the manual the time() function is as i said the number of seconds and if + 10 u shud get a time 10s in the future.

    if you post your code we could maybe see if anything else if affecting it?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •