Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: managing dates?

  1. #1
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    I have dates stored in the yymmdd format. I want to be able to compare if this stored date is the the future or the past. Something like:


    If ( in the past) {
    xxxx
    } else {
    yyyyy
    }


    Is this possible?
    If its not in Family Guy its not worth it.

  2.  

  3. #2
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    well if your dates are stored in that format you can use mktime function
    mktime ( hour , minute, second, month, day , year, is_dst)
    so do it like this

    PHP Code:
    list($y,$m,$d) = explode("/",$date);
    $unix_time mktime (0,0,0,$m,$d,$y);
    if(
    $unix_time<time()){
    // do past here
    }else{
    // do now here


  4. #3
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    Well i ended up using:


    <?php

    if (date('ymd') < $todaysdate ) {
    // Day has not come
    } else {
    // Day has passed
    }

    ?>

    But thanks for your help.
    If its not in Family Guy its not worth it.

  5. #4
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    does that work?
    I guess it would... hey whatever does the job


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com