A
A
Albert Kazan2019-10-14 23:34:21
css
Albert Kazan, 2019-10-14 23:34:21

How to store date of birth in database?

First, I immediately made storage in the form of unixtime. Then he remembered that his report went in the 70s. And what to do next with those who were born before the report.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tokmaganbet1, 2018-07-22
@tokmaganbet1

You can make a regular slider, or just tabs.
Tab example

X
xmoonlight, 2019-10-14
@Farrien

Convert the column to DATE format (instead of DATETIME, TIMESTAMP).

E
evgeniy_lm, 2019-10-15
@evgeniy_lm

Then he remembered that his report went in the 70s. And what to do next with those who were born before the report.

Yeah, those who came up with the unixtime format are completely stupid.
Calculations can also be made in the opposite direction using negative numbers. For example, the date October 4, 1957 00:00:00, which is 4472 days before the start of the countdown, is represented in Unix time by the number −4472 × 86400 = −386 380 800

G
grinat, 2019-10-15
@grinat

Looking at the dates. If from old docks, then only as strings (otherwise you can’t push dates like February 32 in any way), if the user enters, then how convenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question