similar to a "timestamp" in mysql-databases
MySQL and other database software have persistence as one of their primary features: today you may execute a statement like
INSERT INTO ... and its effect remains when you access the database days or months later. Underneath, this is usually achieved by writing to some files, but this detail is hidden from you, the user.
TeX is not a database; it is a program for typesetting. You have a
.tex file, you run TeX on it, and then TeX forgets about the file; it retains nothing for the future. But that seems to be exactly what you want:
My aim is […] to have the data of "1.4.2019" stored […] I want to store a large number of dates […] that TeX generates the current date and stores it statically and unchangeable […] I want to store the values of […] of a specific moment and keep the data and …
This is not what TeX is designed for, but if you want persistence you can easily achieve it the same way databases do: namely, by writing to a file. You run TeX on a file, you have it compute the timestamp (or whatever) and write it to a file, and on later runs it can pick up the data from the file. This is what David Carlisle told you in the comments on his answer:
"store value statically" == "write it to a file" so this is just about the only possible answer.
If you don't want to write to a file then you're asking for the (essentially) impossible.
Sadly,Knuth hasn't thought of implementing the timestamp, so this is the end of the story...
This is not correct. The semantics of
\the\year etc. in TeX are exactly the same as those of the
CURRENT_TIMESTAMP() (etc) functions in MySQL:
If TeX encounters
\the\day on a certain date, then the value is that day's date.
If MySQL encounters
CURRENT_DATE() on a certain date, then the value is that day's date.
There is no difference. The difference is elsewhere: databases are designed to store data (by automatically writing to a file behind the scenes), in TeX you have to do it yourself by writing to a file yourself (which for some reason you don't seem to be satisfied with).