I whas asking myself, since the phpBB is using unixtime stamp what are we doing for dates that are under 1970 01-01 00:00:00.
I mean dates are stored in the database following this algorith:
GMTdate - 1970 01-01 00:00:00 = X seconds.
But if I would like to store birthdates in database and things like that is it going to work
Datetimes in phpBB
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Re: Datetimes in phpBB
Maybe negative timestamps?
Re: Datetimes in phpBB
Why would you want to use time_t for birthdays? That format is for complete time including seconds and you need only date without time.
Formerly known as CyberAlien.
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Re: Datetimes in phpBB
For multi-database support.CyberAlien wrote:Why would you want to use time_t for birthdays
In Access, SQL statements for an INSERT of a date is:
INSERT INTO Table (datetime_field) VALUES (#01/01/1970 00:00:00#)
and in MySQL
INSERT INTO Table (datetime_field) VALUES ('01/01/1970 00:00:00')
So if you store only a value who's a number you don't need a DATETIME field in your database, you replace it with a field who support LONG values.
In the MySQL database right now Dates are stored as INT(11) values.
Re: Datetimes in phpBB
As CyberAlien wrote: These type of fields int(11) is not made to store something before 1970 in it. If you want to store a birthday I would recommend a varchar field, size 10 using the form "1977-05-21"... as it is done in phpBB 2.2 (I just looked up)
th23
th23
Re: Datetimes in phpBB
Thanks, now I understand 8)
Re: Datetimes in phpBB
Date: 12/05/720 10h12m30s
Stamp: -39416939250
... wouldn't fit int(11) though
Stamp: -39416939250
... wouldn't fit int(11) though
Re: Datetimes in phpBB
Why don't they just use the TIMESTAMP column type? It's the easiest.. and times are in a simple to read manner:
20040828125323 would be the timestamp on my computer right now .
Thats:
YYYYMMDDhhmmss
20040828125323 would be the timestamp on my computer right now .
Thats:
YYYYMMDDhhmmss
- A_Jelly_Doughnut
- Registered User
- Posts: 1780
- Joined: Wed Jun 04, 2003 4:23 pm
Re: Datetimes in phpBB
As far as I know, only MySQL has a TIMESTAMP data type. THerefore, using a TIMESTAMP would either require workarounds for other DBMS or dropping support for them altogether.
A_Jelly_Doughnut
Re: Datetimes in phpBB
Negative timestamp is not supported by mycrosoft or ibm server, what is quite logical the way this date is computed (negative values is equivalent to add one digit to type length). unix timestamp is a very limited format (there is also a max value, not only a min value) which prevent date getting over 30 years from now. Therefore, using a unix timestamp for a secular date wouldn't be a smart move .