Product "To" Date

Discussion in 'Payments processing' started by popasmoke, Dec 16, 2015.

  1. popasmoke

    popasmoke aMember Pro Customer

    Joined:
    Oct 15, 2013
    Messages:
    18
    AMember Pro 4.6.1

    In the table "am_access", we would like to use dates up to 9999/10/11 for 'expire_date'. Changing the date in a record using phpmyadmin to 9999/10/11 takes but when you look at the user's product access, the date is changed to 12/31/69.

    What we'd prefer to have is the option to enter TEXT into the end date such as "LIFETIME" instead of using a date such as 9999/10/11.

    Any thoughts?

    Thank you.
  2. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    You can't as the maximum date that can be used with the current epoch is around 2037, any date the blows past that is automatically 'void' and goes back to time '0' which happens to be 1969.

    The simple answer is leave it alone!
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    It is not aMember restriction but limitation of MySQL database. For lifetime access I recommend you to use date 2037-12-31. At least aMember do it this way.
  4. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    Sorry mate, not a database issue, mysql is quite happy with 64 bit integers. The problem is that the 32 bit unix epoch is 1970-01-01 that runs out in 2038 (see article) ... the C time_t constant is 32 bits most systems can't easily be changed from this, not just C, old COBOL applications also have this issue.

    A lot was made of the millennium computer problem (ie rolling over from 1999 to 2000) for most systems it was a non-event, although some of my old bank programs which used julian YYDDDf would have been totally stuffed. The real crunch will be when 32 bit only systems hit the max epoch value they will go back to the 1970's now for me since I have been coding since 1973 I doubt I will be worried.

    Of course, by the time this happens most embedded devices will already be 64 (or 128, 256) bit systems so that moves the date beyond what life on earth will probably need to worry about .. SkyNet rulz huh ;-)
    caesar likes this.
  5. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Larry,

    Yes, you are right.
  6. popasmoke

    popasmoke aMember Pro Customer

    Joined:
    Oct 15, 2013
    Messages:
    18
    Understood; thanks for the responses.

Share This Page