ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Code Snippets  >>  Scripts_Markup Code  >>  PHP Code
 
 


 

 
 PHP Code interview questions  PHP Code Interview Questions
 JSP Code interview questions  JSP Code Interview Questions
 ASP Code interview questions  ASP Code Interview Questions
 CGI Perl Code interview questions  CGI Perl Code Interview Questions
 JavaScript Code interview questions  JavaScript Code Interview Questions
 VB Script Code interview questions  VB Script Code Interview Questions
 Shell Script Code interview questions  Shell Script Code Interview Questions
 Python Code interview questions  Python Code Interview Questions
 WinRunner Code interview questions  WinRunner Code Interview Questions
 HTML DHTML XHTML Code interview questions  HTML DHTML XHTML Code Interview Questions
 XML interview questions  XML Interview Questions
 Scripts_Markup Code AllOther interview questions  Scripts_Markup Code AllOther Interview Questions
Question
1)how i get the current system time using php?
 Question Submitted By :: Anirban Paul
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 1)how i get the current system time using php?
Answer
# 1
U can done it by using current timestamp option.
 
Is This Answer Correct ?    35 Yes 15 No
Tsu
 
  Re: 1)how i get the current system time using php?
Answer
# 2
Using NOW() or Date() you can get current system time.
 
Is This Answer Correct ?    24 Yes 21 No
Somnath
 
 
 
  Re: 1)how i get the current system time using php?
Answer
# 3
<?php
$time_offset ="525"; // Change this to your time zone
$time_a = ($time_offset * 120);
$time = date("h:i:s",time() + $time_a);
echo 'Current time is : '.$time;
?>
 
Is This Answer Correct ?    56 Yes 6 No
Ishtiaq Alam
 
  Re: 1)how i get the current system time using php?
Answer
# 4
<?php
$time_now=mktime(date('h')+5,date('i')+30,date('s'));
print "<br>".date('h:i:s',$time_now);
?>
 
Is This Answer Correct ?    37 Yes 6 No
Rajan
 
  Re: 1)how i get the current system time using php?
Answer
# 5
<?php
$time_offset ="525"; // Change this to your time zone
$time_a = ($time_offset * 120);
$time = date("h:i:s",time() + $time_a);
echo 'Current time is : '.$time;
?>
 
Is This Answer Correct ?    16 Yes 4 No
&2984;&2984;&30
 
  Re: 1)how i get the current system time using php?
Answer
# 6
<?
echo date("H m s");
?>
 
Is This Answer Correct ?    12 Yes 14 No
Ankit
 
  Re: 1)how i get the current system time using php?
Answer
# 7
<?
echo date("H m s");
?>
 
Is This Answer Correct ?    8 Yes 9 No
Fathimath Shamna.m.c
 
  Re: 1)how i get the current system time using php?
Answer
# 8
<?php
$time_now=mktime(date('h')+5,date('i')+30,date('s'));
print date('h:i:s',$time_now);
?>
 
Is This Answer Correct ?    9 Yes 5 No
Monalisha Mohanty
 
  Re: 1)how i get the current system time using php?
Answer
# 9
echo date("Hms");
 
Is This Answer Correct ?    9 Yes 7 No
Wasik
 
  Re: 1)how i get the current system time using php?
Answer
# 10
echo date('h:i:s');

h: hours
i: minutes
s: seconds
 
Is This Answer Correct ?    9 Yes 9 No
Irfan
 
  Re: 1)how i get the current system time using php?
Answer
# 11
<input type="text" value="<?php echo date('h:i:s');?>"/>
 
Is This Answer Correct ?    8 Yes 4 No
Sanju
 
  Re: 1)how i get the current system time using php?
Answer
# 12
To get the local time, you have add your time zone offset.
So the function is correct.

$time_offset ="5.5"; // Asia/Kolkatta Change this to your
time zone
$time_a = ($time_offset * 120);
$time = date("h:i:s",time() + $time_offset);
echo 'Current time is : '.$time;

One another method is setting the time zone in php.ini file
or setting it in your script page using this command.

date_default_timezone_set ("Asia/Calcutta");
 
Is This Answer Correct ?    3 Yes 1 No
Prince Joesph
 

 
 
 
Other PHP Code Interview Questions
 
  Question Asked @ Answers
 
How to Connect and Insert Record to MYSQL using PHP?  5
1)how i get the current system time using php?  12
Hi I have a dynamic dropdown reading in data from a MQSql database, I need to refresh just the dropdown (not the whole page) for any new values in the database. I am trying to use the getElementById in javascript but I have no idea how to get it to refresh. Does any one have an examples or any ideas how this can be done? Regards Srilanka_3  4
 
For more PHP Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com