Why do you invent your own storage type in the database system? Use the database system's own date/time facilities; that makes it easier to work with your data.
Also: Make sure that you learn how to use the unix timestamp system (number of seconds since Jan 1, 1970 - very handy, actually). The unix timestamp is a highly "neutral" way to work with time.
Finally:
MySQL has some handy functions which you may use in your SQL:
unix_timestamp()
from_unixtime()
They are described in MySQL's manual.
Other than that, it's hard to help because you are not very precise about what coding-problems you need to solve.