Generate Datetime in the future without UNIX timestamp

2014-08-20T18:05:17

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

About “Generate Datetime in the future without UNIX timestamp” questions

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
I created the following test case to understand the conversion of between DateTime to Pandas Timestamp, to Unix Timestamp, and back to DateTime, with and without TimeZone info, with Python 3.6 from
The Sqlite documentation states: SQLite has no DATETIME datatype. Instead, dates and times can be stored in any of these ways: As a TEXT string in the ISO-8601 format. Example: '2018-04-02 12:13:...
I have to create an "Expires" value 5 minutes in the future, but I have to supply it in UNIX Timestamp format. I have this so far, but it seems like a hack. def expires(): '''return a UNIX st...
I want to convert a DATETIME from a column to a UNIX TIMESTAMP. But the thing is that those dates are in a distant future, such as 2066-09-01... You can try those simple queries: SELECT UNIX_TIMES...
I'm trying to do something really simple, convert a datetime object three days into the future into a Unix UTC timestamp: import datetime, time then = datetime.datetime.now() + datetime.timedelta(...
I have a list of unix timestamps that all contain milliseconds -- they are 13 digits long. When I run the timestamp through datetime.fromtimestamp(unix_timestamp) it returns a ValueError: Year Out of
People can buy an account on my website for 1, 2, 3, 4 or 5 years. I want to store this period in a table. This is my table (for now): table: users - user_id int(11) - username varch...
I have a table with statistics and a field named time with Unix Timestamps. There are about 200 rows in the table, but I would like to change the Unix timestamps to MySQL DATETIME without losing the
I'm trying to convert a datetime field, which is set to EST, to a UNIX timestamp. But the catch is, the timestamp should be set to midnight UTC. For example, May 1 2015 would be 1430438400000 ...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.