Session Start: Tue Sep 12 12:07:53 2000 *** Now talking in #netsurprise *** Topic is 'WEBMASTERS ONLY!!! Welcome to the Net Surprise Adult Webmaster IRC Chatroom.' *** Set by SurpriseBot on Sat Sep 09 03:47:33 -SurpriseBot- Welcome - Net Surprise IRC - thud.net channel #netsurprise ok :) <_Splitz_> julloooooo what's up, splitz? This stuff may be too technical for me..but thought I would give it a try. <_Splitz_> just getting home and relaxing Electra, well you ask me whatever you feel like :) When you noted that we don't need all this garbage, were you referring to the < Doctype..... or to all of the html header information in general? Thank you TD yeah, sharkysr You can do it Electra. *** SusieS has joined #netsurprise how techie you feel like going td? hello Yea what td? all of the html? Right now everything we are doing ... well time is incrementing right? no, sharkysr just the tag at the very top is more or less a description tag for the HTML OK, thanks document type is for the most part useless kind of like "author" and some of the other tags you can add to html Excuse me..is there somewhere I can see this as you are doing it? they don't hurt anything being there, but you don't "have" to have them http://www.adultnetsurprise.com/learning_center/php/php_week_2.html just decreases relevencey for spiders thanks Timewalker, we can go as advanced or as basic as people here would like :) can somebody else log this for me as I am having some problems with mIRC here :( and i want to make sure this is logged td I am logging I believe let me check thgough ok I restart my log so I can find this thank you :)) yup logging :) Well this is a server type thing actually http://www.tdscripts.com/time_dates.html <--- here is a url to the UNIX timestamp *** Snikks has quit IRC (QUIT: User exited) hmm, well you can ask tw and if i know it, i'll be happy to answer. I'm not really much knowledgable on the server, i must admit how do you log TD? as i was saying, does everybody here know what a timestamp is? er, a UNIX timestamp Been looking at switching my .htaccess to mysql is there anything I so look out for in that area? 965587619 <--- a unix timestamp hmmm, i hear that is pretty good to do, tw that long string of numbers is the number of seconds since 1970 january 1, 1970 as we are here talking the time is increasing of course ... and this is how we figure out time elapsing between two points we grab the timestamp say when something happens ... and then we grab the "now" time and compare the two fundamentally this is how every program that calculates time operates $now = time(); <-- gives you the current timestamp so if you wrote: that would print the current UNIX timestamp if you click on my example you'll see the timestamp is increasing <_Splitz_> TDavid, you mean epoch seconds? http://www.tdscripts.com/cgi-bin/timetest.cgi splitz the epoch will be January 1, 2038 at midnight that is when the REAL y2k will happen, IMHO <_Splitz_> I thought seconds from Jan 1 1970 were called Epoch seconds well in the instance of keeping people from getting confused a second is a second :) <_Splitz_> heh if you want to call it an epoch second, that's fine with me :)) <_Splitz_> Mac's are fine until the year 32,745 or some shit macs have a few things up on PC brains it seems :) <_Splitz_> yup yup ;) 968782964 <--- current time stamp number of seconds since Jan 1, 1970 ... so let's say we want to figure out how long since something happens So if you want something to occure every 24 hours, you could check the time stamp, and each time it increment 86,400 seconds then it's time to do it again, right? <_Splitz_> yup or you could crontab a script to run at a specific time daily *** MissGwendolyn has joined #netsurprise *** SurpriseBot sets mode: +o MissGwendolyn Hello everyone =) yeah daily tasks are best run by cron, but even cron operates off of a timestamp fundamentally <_Splitz_> hi gwen Yea Splitz, I use the crontab, but in speaking in basic terms, that is what the crontab does anyway, right? ok well techniquely speaking your way over my head already LOL not hard I am 4'10" hehe hehe, susieS what part do you not understand? 968782964 <--- current time stamp = number of seconds since January 1, 1970 <_Splitz_> sharkysr, sort of, crontab runs 24/7 and has a pending DB of when to do things yeah yeah got that but where did you get the number from you can grab a unix timestamp by doing this: $now = time(); and php will return the current unix timestamp now you add that to what? <_Splitz_> eliminates the load/quit time of your program repeatedly when it needs not do anything ahhhhhhhhhhhhhhhhh the PHP thing I still haven't gotten lesson one to work yet LOL well what gave you pause in the first lesson, feel free to ask any question you didn't understand I am happy to try and help you through it $now <--- a variable ... = <--- an assignment time() <--- a php "function" which will return the current UNIX timestamp now we could say this ... $past = 968782964; $now = 968783310; td I posted what I had done in the message board now what would be the mathematical computation to determine how many seconds have passed? and mine looked nothing like the others I guess I didn't understand how to start it all off i saw it, and I commented on it. did you get chance to read my comments yet? not yet looking now well you know how to start an HTML tag of course, php must be enclosed in a tag too <--- end a php script everything in between will be code or comments to be run through the parser who can post the expression to determine $elapsed? $elapsed = ??? $past = 968782964; $now = 968783310; Basically - UNIX started a timer running at 12:00:01 on January 1, 1970, and it is still running today, so that time stamp is just the total number of seconds since they started the timer, right TD? correct $elapsed=$now-$past bbl *** MissGwendolyn has quit IRC (QUIT: User exited) yup now we have the number of seconds so we can convert back into minutes or hours or days so if we wanted to "do something after 24 hours had gone by" what would be the mathematical computation? ok so read that now $elapsed/56,400 86,400 yes if ($elapsed >= 86400) { do this; } if you wanted to say delete all posts on a messageboard older than 1 year ago, see how it could be done now? then reset $past yea, that should be pretty easy *** Steve is now known as Steve-Away 86,400*365 if ($elapsed >= 31104000) { do this } yeah you got it, my calculator doesn't go up that high hehe A sign in a Japanese hotel not enough digits! "You are invited to take advantage of the chambermaid." oops if ($elapsed >= (86400*365)) { do this } <-- prolly easier now there are built in functions in PHP to take a UNIX timestamp and turn it into a normal date that function is of course called date() the syntax is as follows: date($format, $timestamp); so if we want to display the date something happened from a timestamp we don't have to do the whole chore of calculating the years from the seconds just to display a date but with the information you have now, I'm sure you could figure out HOW to do it not really I don't understand the syntax well what do we know about the timestamp? :( still didn't work when did it start counting? it is a big number we know that well this is mathematical then it should be easy *** EclectiXXX is now known as Eclecti_AFK what was the UNIX timestamp on January 2, 1970? at midnight 86400 ? no yes 172800 The timer started at zero January 1, 1970 at midnight? so midnight the next day is 24 hours 24 * 3600 = 86400 OK. I thought it was 1 second after midnight from the 31st of december 1969, so it would have been the first second of 1970 well yes, technically you are correct hehe :) 12:01 am January 1, 1970 so it would be 48*3600 yes, I stand corrected :) no matter, it was a long time ago.....hahaha now what if we want to find out what timestamp was January 1, 1990 ? Without doing the math, I don't know??? *** burbon has joined #netsurprise *** burbon has quit IRC (QUIT: User exited) $jan11970 = (86400 * 365 * 20); or would it be ... $jan11970 = (86400) * (365 * 20); 1990 you referring to?? $jan11990 = 86400 * (365 * 20); yes either way you get the same number <_Splitz_> TDavid, can't you give time() a date though? <_Splitz_> You can in perl well you give date() a time <_Splitz_> nah, there's a reverse lookup function *** washiez has joined #netsurprise <_Splitz_> you give it a human readable time and it'll convert it to epoch *** washiez has left #netsurprise same thing really, you just turn a timestamp into a date or a date into a timestamp ... whatever the case, it is the understanding of the calculation that is important we could make our own function to do that *** Psychic-A has joined #netsurprise <_Splitz_> TDavid, one thing with doing it yourself, leap years allo yup <_Splitz_> yo Psychic, you ho TD *** washiez has joined #netsurprise h0 h0 h0 ! Ahaha what's up psychic-a :) nudda u? <_Splitz_> ok, pond invasion? <_Splitz_> yuns get thrown out? Splitz, your 0wned! td I posted my still not working code lol you can get to it later hahahaha <_Splitz_> washiez, you wish ;) netpond castaways what brings u here <_Splitz_> me here? OK, TD what was the point we were trying to get to on the timestamp <_Splitz_> Tired of the rectal rule of the pond <_Splitz_> heh rectal? <_Splitz_> ya, nice way of saying assholes =P point is, there really is no DATE inside a computer it is nothing more than a big timer that is always ticking Gee thanks splitz. ;-0 <_Splitz_> washiez, are you a ruler of the pond? so when you need to figure out how much time has elapsed, you need to think of time and not dates <_Splitz_> ok then do new servers still have the same stamps on them I mean did they still start back in 1970? yes *** washiez has left #netsurprise it's in the chip *** MrMarylou has joined #netsurprise OK. so is there a function that will give you the time elapsed based on dates, or would that have to be written <_Splitz_> heh ok thanks brb *** TimeWalker has quit IRC (QUIT: User exited) yes you can use mktime er mktime() all those codes can cause confusion, but in the course material I've provided you with a list of the date codes yes you can use mktime er mktime() I know your sorta doing lessons OK, well I'm getting lost in this. I understand the math behind the time, but where are we heading with this TD? but I had a question about cookies and reading em :) sharkysr, i just explained that, did I not make myself clear? point is, there really is no DATE inside a computer it is nothing more than a big timer that is always ticking you need to remember that later I understand that. so when you are asked to write a program that does something based on the amount of time that has passed you know how to do it, yes? Parse error: parse error in /www/r-smedia.com/lesson1.php3 on line 6 SusieS what does that mean? yea, basically. That shouldn't be a problem TD. it means your syntax is out of whack, will you cut and paste line 6 to this channel please? print($myname Dj's at $myfavoritve_url on $my_show .$comments); you need to enclose strings in double quotes that *** MrMarylou has left #netsurprise print("$myname Dj's at $myfavorite_url on $my_show. $comments"); you can only print a variable by itself without double or single quotes print($myname); <-- no error print($myname Dj's); <-- error php thinks that you are trying to execute a function named Dj but the syntax is wrong ok got it to work ehhehehehehe thanks much a bare word by itself implies you are using a function ... like print like date now if I can just get it to not show the underscores then that would look cool hehehe so it expects an "argument" behind that :) *** washiez has joined #netsurprise I see ok now let's get back to formatting a date from a timestamp yea *** Wolfe has quit IRC (Connection reset by peer) print(date("h:i:s", $timestamp)); // returns current time *** washiez has left #netsurprise That is a much simpler way to display the time then the JavaScript I have on my site pages...haha ' '= variables and " " = arguements they equal strings, susieS for example ok print('1'); is the same as: $string = 1; print($string); ok what if I want the time displayed in est? great question, you need to get a time offset I see ok thanks td I think it is getting clearer first you need to know what time your SERVER is operating at *** Eclecti_AFK has quit IRC (QUIT: User exited) because that is where the timezone will originate and how do we find that out? ok it is in cali or .. it is better for universal programming to use GMT so that is PST, right? yes that is PST any idea how we might get a time offset? how do you determine GMT from wherever you are, or your server is?? use gmdate() ok so gmt is 08:00 for cali great, that makes it even easier... I use my clock lol on the pc hehe susieS :) actually one way to do this is to use JavaScript, because javascript is client side, right? well I go to settings for it and look up wehre i want to know so you could compare the current GM date to the local date using JavaScript and get a time offset might be +5 or -5 hours *** Sassy has joined #netsurprise or some other number ok and then you simply subtract that from the server time hey sassy hi SusieS *hugs* subtracting a positive and a negative will still give you the correct offset, correct? what thde heck happened to Wolfe ? 5 - +3 = 8 TD .. hey there :-) hi ww how are you ?? I havent talked to you in forever *** Wolfe has joined #netsurprise *** MrMarylou has joined #netsurprise good, im just finishing up a workshop here :) and I missed it :-( does anybody have any questions on time/dates? *** WilliamC has joined #netsurprise *** Snikks has joined #netsurprise yes ... Can you repeat that workshop ??? hehe hehe, that's not a question, that's a request wolfe lol =-) Wolfe you should have logged it and Im sorry about the power again .. was the micro on or just plugged in ? TD on yes, sharkysr? I've got a question on the 5 - +3 = 8 thing well thats why ... shut the blower down if you are gonna use the micro ... how do you make that work? THe blower wasn't on !!! I told you what was on !!! 5 - -3 = 8 it wasnt ??? *** WilliamC has left #netsurprise nothing we don't have on normally was on ... damn .. I will send Don out today to check out the breakers .. maybe one is bad okay TD, you still there? I'm really getting tired of loosing my work cause the breaker decides to pop wolfe i have the workshop logged if you need it UPS is the answer to that Wolfe start saving things regularly yes, im getting back to work though now got a zillion things piling up ... we can continue this in script school * SusieS was very glad to have ups lastnight for sure Did you see my questions, TD? I wanted UPS td you see the priv from me? yes, but I only have an hour for workshop allotted and phone is starting to ring through now hmmm... Td thanks now that I have lesson one working I will tacle lesson 2 *** sharkysr has left #netsurprise SusieS a log of the workshop would be great please post to messageboard your questions and I will answer or come over to script school later :) ok will sent to you dcc *** Adent has joined #netsurprise thanx thank you for coming everyone I have ot catch up on lesson 1 still hehe cya folks hey TD !! hey what? it was really nice seeing you ... :-) nice seeing you too :)) *** Sassy has left #netsurprise stop by script school once in awhile :)) Session Close: Tue Sep 12 13:20:25 2000