created_at. This is a timestamp that shows when each row was created. This is easy to set as a column in our
created_atvalue is set automatically.
created_atdata, which records the date, time and timezone of a row, we don't have any easy way to render that date data into an edit form (although in real life you would probably never want to edit this information).
datetime-localinput type in HTML but that it is not cross-browser compatible.
DATEdata type in our tables for user-generated date data.
sightingsexample above we make the distinction between
created_at, the date the row was created in the database, and
date, the date of the UFO sighting.
created_atis of type
TIMESTAMPTZbecause it is auto-generated and does not require a form input.
dateinput type in a form. In production applications this would also not be ideal, since
dateinput types are also not well supported (about 90%), but they are much more prevalent than the
datetimeinput type. See browser compatibility of the
dateinput type here.
DATEtype in the Postgres table we specified above matches the input format we specified in the input form, we can simply pass what's in
request.body.dateright into the database.
datetime-localinput type. Chrome supports
datetime-localand the field value can be inserted directly into a Postgres
dateinput type and create a separate input field for time data. Store time data in Postgres using a separate column. Example here. In production applications we would always want to store timezone data, but in Coding Bootcamp Module 3 it's not recommended due to input limitations.