Lets say today is the 08.20.2014
.
I want to get the date from "today" additional 30 years (08.20.2044
) with PHP and insert it into my mysql Database with it´s Datetime
field.
How do I correctly generate the YYYY.MM.DD H:i:s without using the UNIX timestamp?
If i use
mktime()
-> I get a UNIX timestamp (Limited, has a maxyear 2038, so nonsense)
time()
-> I get a UNIX timestamp
date()
-> I need a UNIX timestamp
strtotime()
-> Im converting from/to UNIX timestamp
Am I completly missing a point?
What is the sense of using DATETIME
if I´m using the UNIX timestamp in my code which is limited (I know that DATETIME is also limited to the year 9999)?
Copyright License:
Author:「Top Questions」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/25402000/generate-datetime-in-the-future-without-unix-timestamp