| | |
Indian date-time function plz?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 161
Reputation:
Solved Threads: 6
Hi frnds...
i m using date time funtion in many ways..but i m not getting indian timings...plz tell me how can i exact indian timings...
i used all the below functions...
i need only for a single page..
i m using date time funtion in many ways..but i m not getting indian timings...plz tell me how can i exact indian timings...
i used all the below functions...
•
•
•
•
php_value date.timezone "Asia/Calcutta"
echo date('d-m-Y H:i:s');
putenv("TZ=Europe/Istanbul");
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
0
#2 Oct 30th, 2009
•
•
•
•
Hi frnds...
i m using date time funtion in many ways..but i m not getting indian timings...plz tell me how can i exact indian timings...
i used all the below functions...
i need only for a single page..
You May Use the Below Specified Script for Getting Indian Time in Text Box:
PHP Syntax (Toggle Plain Text)
<html> <body> <?php $time_now=mktime(date('h')+5,date('i')+30,date('s')); $time_now=date('h:i:s A',$time_now); ?> Time: <input type="text" name="dat1" value="<?php echo $time_now; ?>"> </body> </html>
http://www.kuchamancity.com
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
•
•
Join Date: Aug 2008
Posts: 161
Reputation:
Solved Threads: 6
0
#3 Oct 30th, 2009
Hi hemgoyal,
Thanks for ur reply..
here i m getting wrong time...now i m in INDIA..here present time is 11.26 am......but the code displays 04:25:59 PM...
i need indian time zone ..i m using database MYSQL...
plz tell me...
Thanks for ur reply..
here i m getting wrong time...now i m in INDIA..here present time is 11.26 am......but the code displays 04:25:59 PM...
i need indian time zone ..i m using database MYSQL...
plz tell me...
•
•
•
•
You May Use the Below Specified Script for Getting Indian Time in Text Box:
PHP Syntax (Toggle Plain Text)
<html> <body> <?php $time_now=mktime(date('h')+5,date('i')+30,date('s')); $time_now=date('h:i:s A',$time_now); ?> Time: <input type="text" name="dat1" value="<?php echo $time_now; ?>"> </body> </html>
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#4 Oct 30th, 2009
using just -
should do actually.what is the problem with this.
PHP Syntax (Toggle Plain Text)
date_default_timezone_set("Asia/Calcutta"); $d = date('Y-m-d H:i:s');
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 161
Reputation:
Solved Threads: 6
0
#5 Oct 30th, 2009
hey...thank U...
this time i m getting error...
error:
this time i m getting error...
error:
•
•
•
•
PHP Fatal error: Call to undefined function: date_default_timezone_set()
•
•
•
•
using just -
should do actually.what is the problem with this.PHP Syntax (Toggle Plain Text)
date_default_timezone_set("Asia/Calcutta"); $d = date('Y-m-d H:i:s');
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#7 Oct 30th, 2009
Its clear you are running the older version of PHP and the date_default_timezone_set() is not supported.
check date.timezone in php.ini
check date.timezone in php.ini
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Aug 2008
Posts: 161
Reputation:
Solved Threads: 6
0
#8 Oct 30th, 2009
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
0
#9 Oct 30th, 2009
You may Use The Below Specified Code. This Code is Work Fine for Me:
PHP Syntax (Toggle Plain Text)
<?PHP $time_now=mktime(date('h'),date('i'),date('s')); $time_now=date('h:i:s',$time_now); $time_zone=date('P'); //This will show Time Zone echo "The Current Time Zone is $time_zone and Date is: "; echo gmdate("M d Y"); //Date Creation echo " Time is: $time_now"; ?>
http://www.kuchamancity.com
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
•
•
Join Date: Oct 2009
Posts: 102
Reputation:
Solved Threads: 18
0
#10 Oct 30th, 2009
hmmm, your PHP version is fine.
Can you not run the code hemgoyal_1990 included in the above post?
Try running the following code to figure out your actual runtime PHP version if it still gives you a function missing error.
Can you not run the code hemgoyal_1990 included in the above post?
Try running the following code to figure out your actual runtime PHP version if it still gives you a function missing error.
PHP Syntax (Toggle Plain Text)
<?php echo 'Current PHP version: ' . phpversion(); ?>
![]() |
Other Threads in the PHP Forum
- Previous Thread: pls help me to figure this out
- Next Thread: implementing XML
Views: 1249 | Replies: 27
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date development directory display download dynamic echo email error file files folder form forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





