ALLInterview.com :: Home Page            
 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
# 11
<input type="text" value="<?php echo date('h:i:s');?>"/> 
Is This Answer Correct ?    16 Yes 25 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 ?    25 Yes 7 No
Prince Joesph
 
  Re: 1)how i get the current system time using php?
Answer
# 13
//first write this code on top of your file in which you
want //to display the date or time or both.

date_default_timezone_set('Asia/Calcutta');


//only for indian users and for people form different parts
//just check this link and set the values within single
//quotes http://in.php.net/manual/en/timezones.php

//now output date or time at any place in your file as shown

echo date("m/d/Y");
echo date("G.i:s");

Thank You
 
Is This Answer Correct ?    14 Yes 8 No
Shahrukh
 
  Re: 1)how i get the current system time using php?
Answer
# 14
just ask computer how to get the time..ok 
Is This Answer Correct ?    8 Yes 12 No
Allu
 
  Re: 1)how i get the current system time using php?
Answer
# 15
use your mind...this is very simple question... 
Is This Answer Correct ?    11 Yes 18 No
Tom
 
  Re: 1)how i get the current system time using php?
Answer
# 16
use following line in your code :

date_default_timezone_set (“Asia/Calcutta”);

to set timestamp according to your area....

Here Calcutta is an Asian City name...Set it to yours one...
 
Is This Answer Correct ?    8 Yes 2 No
Askphpexpert.wordpress.com
 
  Re: 1)how i get the current system time using php?
Answer
# 17
putevn("Asia/Calcutta");

Write this is to your php page and
just
write echo $time = date("H:i:s",time());
 
Is This Answer Correct ?    5 Yes 1 No
Prabu
 
  Re: 1)how i get the current system time using php?
Answer
# 18
echo date(DATE_RSS);

This will display all information including DAY OF THE WEEK,
DATE, MONTH, YEAR, TIME && TIME ZONE.

ie., a sample output will be:

Mon, 01 Nov 2010 10:47:05 +0030
 
Is This Answer Correct ?    5 Yes 2 No
T.rajkumar
 
  Re: 1)how i get the current system time using php?
Answer
# 19
<?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 ?    2 Yes 3 No
Akhi
 
  Re: 1)how i get the current system time using php?
Answer
# 20
<?php
print time();
?>
 
Is This Answer Correct ?    3 Yes 5 No
Divya
 

 
 
 
Other PHP Code Interview Questions
 
  Question Asked @ Answers
 
1)how i get the current system time using php?  22
What is main difference between Cookie and Cache? NIIT3
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
Which framework is best in php among Smarty, Cakephp, Joomla, Drupal, Zend or Something else...? If any then Why? Hcl1
hi sir actually i use now day's ajax but i m having problem my opinion i thing this code is right becuse i make code for my side validation with ajax in php so but it is not run complete i m posting my code pls confirm and clear my some mistake and return send me with informatiom what was error so next time i will be care fully so i m sending u but replay so quick because tomorrow i have to present it some where,frist one is index.php and second is show.php show.php is database connectivity for testing  1
What is meant by 404 errors in php? NIIT2
How can get current system time continuously without refresh of page?  1
If i have an array $string = array(1,2,6,2,9,6,7,3,1,2); How can i get only unique values from it? Array ( [0] => 1 [1] => 2 [2] => 6 [4] => 9 [6] => 7 [7] => 3 )  1
What is used of phpinfo() function in php?  1
How many frameworks are in php?  1
I have array like $array = array(1, "hello", 1, "world", "hello"); if i want the following output then how can i do this? Array ( [1] => 2 [hello] => 2 [world] => 1 ) NIIT2
How to Connect and Insert Record to MYSQL using PHP?  6
 
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 © 2012  ALLInterview.com.  All Rights Reserved.

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