hi..i need the current time according to my system time..i usually get this as the GMT but i want in IST..if i assign tht as $now. then i want the time after 15mins(900 sec) as $endtime.
how do i do tht?
help needed urgently
thanks in advance
hi..i need the current time according to my system time..i usually get this as the GMT but i want in IST..if i assign tht as $now. then i want the time after 15mins(900 sec) as $endtime.
how do i do tht?
help needed urgently
thanks in advance
Just a guess, never tried this:
$NOW ( ) + 900;
?
$endtime = time()+900;
That's the more standard way, i'd think.
Above uses now, which I think is a synonym for time and both a dollar sign and (), meaning it's a variable and a function? Pretty sure this is invalid.
Perhaps this is syntax borrowed from another language.
Also note that in PHP case matters, so NOW is not the same as now, which I believe is the function in question: now().
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Opps my error.
Im sure the php now function is NOW ( ).. or is that just in mysql queries?
Yea, it was meant to be a function, i got side tracked and was meant to type
$time = NOW ( ) + 900;
I think that would apply to mysql.
Again, the function in question is now(), if anything, in lowercase, since PHP functions are case sensitive.
The official function for the current timecode is simply time(), and this is standard.
I'm also not used to placing the parentheses apart from the word, though this may be valid, but I wouldn't know without some testing.
EDIT: http://www.php.net/manual/en/function.time.php
There is no mention of the now function in the documentation nor search function. I think this must just be mysql.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Yea, i understand what your saying. Thanks for the help. Even though it wasnt my thread i have learnt a lot from you![]()
Sure. And remember that php.net is very easy to use to check any function. Just type it in the search bar and look it up, and it'll give example situations with demo scripts so you can know how to apply it to your page, at least the basics. With that to start you off, the rest is just putting various functions together.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I'm confused as to what you want. Do you just want the time formatted to INdian Standard Time?
Perfectly valid. PHP will take the contents of the variable and use it as the function name.
See above.Perhaps this is syntax borrowed from another language.
This is just wrong. PHP variable names are case-sensitive. However, function names are case-insensitive. NOW() and now() are equivalent. It is just considered good form to use the correct case.Also note that in PHP case matters, so NOW is not the same as now, which I believe is the function in question: now().
I wasn't aware of that. That's good to know. However, in this case, there was no place where $now was set to the value of 'time'.Perfectly valid. PHP will take the contents of the variable and use it as the function name.
As for the case, wasn't aware of that either. Alright.
Still, now() doesn't do anything.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks