Welcome, Guest. Please Login or Register.
August 29, 2025, 06:14:31 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  Under MySQL, Instant Messages, what does each number mean for the time? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Under MySQL, Instant Messages, what does each number mean for the time?  (Read 350 times)
Merco
Noobie
*
Posts: 7


I'm a llama!

Under MySQL, Instant Messages, what does each number mean for the time?
« on: April 19, 2002, 05:24:42 PM »
Reply with quote

Im looking at the instant messages which I've recieved using the mySQL thing, but the time it was sent is just 10 digits. What does each digit mean?
Thanks, im just curious.

-Richard
Logged
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #1 on: April 19, 2002, 05:26:52 PM »
Reply with quote

this digits are the seconds gone since 1.1.1970
Logged

mainComm Dev Team
Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #2 on: April 19, 2002, 05:42:24 PM »
Reply with quote

FYI: After my database analysis they should be DATETIME in future version (1/2 the space required)
Logged

You can't have everything... where would you put it? -- Steve Wright
Merco
Noobie
*
Posts: 7


I'm a llama!

Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #3 on: April 19, 2002, 08:27:02 PM »
Reply with quote

That should save quite a bit of space, especially if there is a lot of messages and not a lot of web space!

-Richard
Logged
Merco
Noobie
*
Posts: 7


I'm a llama!

Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #4 on: April 19, 2002, 08:36:16 PM »
Reply with quote

So for the 1.1.2002 the calculation should be:

60x60x60x24x7x52x32

So thats second x minutes x hours x hours in a day x week x weeks in a year x 32 years

But that gives around 60383232000, but MySQL reads around 101923000, which is only around 3.2 years ago.

Am I doing something wrong?

-Richard
Logged
Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #5 on: April 19, 2002, 09:07:49 PM »
Reply with quote

* Greg reaches to get his bible off the shelf:- PHP and MySQL Web Development, he also reaches for his printout of the database schema he's working on.

Right then...
Currently the IM time is stored as a bit integer (8 bytes - when unsigned maximum is 263-1 or 9,223,372,036,854,775,807 which when divided by the seconds in a year (31,557,600) gives you
292,271,023,045.31 years of possible dates - now as you can see the planet will most likely be destroyed along with the universe as we know it so...

...we use DATETIME, which uses 4 bytes and gives us until 9999-12-31 23:59:59 (still plenty of time and a little faster) :)

And I've been doing this with loads of fields for instance: we don't expect 4,200 million people to use YaBB so a mediumint will do (max 16,777,215), and so on and so on, with all the fields until they are all their proper size :)

And so ends today's lesson on relational database design. :)
* Greg closes his bible ;)
Logged

You can't have everything... where would you put it? -- Steve Wright
Merco
Noobie
*
Posts: 7


I'm a llama!

Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #6 on: April 19, 2002, 09:13:02 PM »
Reply with quote

Right....
So how can I work out a time then  ? :D
If I was to make one up?
Logged
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #7 on: April 19, 2002, 09:54:45 PM »
Reply with quote

Greg - the limitation with using datetime fields however, is that you need to then convert them to unix time stamps to do any calculations or display functionality on them.

It was decided VERY early on (the first fricking week of development  ;) ) of YSE to use unix timestamps instead.
Logged

Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Re:Under MySQL, Instant Messages, what does each number mean for the time?
« Reply #8 on: April 20, 2002, 06:40:26 AM »
Reply with quote

In that case I'll see if we can use a smaller numeric field, I'm sure most things won't be around in 292,271 million years! :D
Logged

You can't have everything... where would you put it? -- Steve Wright
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Under MySQL, Instant Messages, what does each number mean for the time? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.039 seconds with 17 queries.