time()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

time()

Post by psychotomus »

whats the longest length time() can return?
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

on 32 bit processors, time() should stop in a few years, if I'm not mistaken. But by the time we get around to then, we'll all be 64 bit anyway. ;)
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Depends on how far in time you think your application will be around.

Y2K :)
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

well this doesnt help me much.


I need to create a Field in sql table based upon the time length. What length would you say would be safe to use? 10? 15? 20? without making it like 100 which would make it safe ^_^
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

10 is the maximum length of the values that the date() function can currently generate. (9999999999 = Monday, January 18th, 2038 - 8:14 pm). I usually use length 11 because I figure that should last long enough.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

if you store in a database, then by all means, don't save it as a string, because what is it you are going to store? time? integers, what size? 32bits... which leaves us with "int" as the datatype, unsigned. if you want to be thinking ahead then you are to use bigint (64bits I think).
Post Reply