PDA

View Full Version : Can someone give me some pointers on VB time display?


07-14-2000, 09:37 PM
Hey experienced vb hackers.

I used to hack UBB scripts all the time without too much of a problem although now it takes me HOURS to hack something ridiculously simple simply because it's php and I'm very new to php.

I've gotten over a few hurdles but one of them is really puzzling me. How does one calculate time? I see all these numbers like this

962819438

And they make no sense to me. Can someone help me out? Thanks a bunch!

07-14-2000, 09:46 PM
That's a unix timestamp - amount of seconds from Jan 1, 1970 I think.

Go to http://www.php.net and check out the time/date functions (time() and date() specifically).

07-14-2000, 11:34 PM
Ahhh that's what UNIX_TIMESTAMP meant! (in bold capitals nonetheless) I feel stupid! :P

thanks ed!

07-15-2000, 08:52 AM
time() gives you the curretn tiem in that format. date() formats it to be readable


$Date = date($dateformat,$timestamp+(($timeoffset+$bbtimez oneoffset)*3600));

$Time = date($timeformat,$timestamp+(($timeoffset+$bbtimez oneoffset)*3600));


that's how you get the time and date from $timestamp with the user's timeoffset he defined in his prefs.