Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4328230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:39:12+00:00 2026-05-21T09:39:12+00:00

How do I store a credit card’s expiration date if it only consists of

  • 0

How do I store a credit card’s expiration date if it only consists of the month and year?

The date field in mysql accepts the following format: yyyy-mm-dd. An expiration date without a day is not invalid using that format.

Do I use varchar, instead? And does that not prevent me from making calculations to determine when cards expire and what not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:39:13+00:00Added an answer on May 21, 2026 at 9:39 am

    For Jan 2014:

    2014-01-00
    

    It’s common to use 00 for month and day that are undefined. From the MySQL reference manual:

    Some date functions can be used with “zero” dates or incomplete dates such as ‘2001-11-00’, whereas others cannot. Functions that extract parts of dates typically work with incomplete dates and thus can return 0 when you might otherwise expect a nonzero value. For example:

      mysql> SELECT DAYOFMONTH('2001-11-00'), MONTH('2005-00-00');
          -> 0, 0
    

    and later on in the manual for DATE_FORMAT:

    Ranges for the month and day
    specifiers begin with zero due to the
    fact that MySQL permits the storing of
    incomplete dates such as ‘2014-00-00’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I store my users' credit card's expiration date & last 4 digits? The
I am taking credit card details and I am taking the expiration date in
I'm going to be implementing a PHP/mySQL setup to store credit card information. It
I'm running ASP.NET MVC and need a safe way to store credit-card data temporarily
We need to store customer credit card and personal info. Id like to look
How can paypal store credit card numbers and CCV without worrying that the database
I'm building an application that accepts credit card orders, but does not programatically authorize
For my ecommece site, I want to store partial credit card numbers as string,
Yeah... just thinking about it... Should I store credit card numbers that have been
I have the following code to read a credit card number from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.