[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Is there PHP web service to display the IST date and time?

Posted on 2008-11-06
6
Medium Priority
?
1,001 Views
Last Modified: 2012-05-05
I need a php web service to display  the IST time. In my website the date is often changed, So I could not either convert them to my IST date and time or display the current date and time?
0
Comment
Question by:Loganathan Natarajan
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:cr4ck3rj4ck
ID: 22902622
Hi there,

Try this, hope it helps.

CJ
<?php
//Get GMT Date/Time and adds offset to IST
echo gmdate("F j, Y, g:i a", strtotime("+5 hours 30 minutes")); 
?>

Open in new window

0
 
LVL 36

Author Comment

by:Loganathan Natarajan
ID: 22903024
Thanks for the reply. I have already this code and displaying the IST time. My actual problem is the server GMT time gets varies every day. It is not reliable ... as i am using shared hosting.. very difficult to explain this problem to them... also they just reset and again the problem arise ... so i  don't want to depend on them ... that is why i want to access the web services....

any ideas?
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 22904828
Take a look at this page:
http://wwp.greenwichmeantime.com/time-zone/asia/india/time.htm

Also, see here:
http://www.ntp.org/

HTH, ~Ray
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 36

Author Comment

by:Loganathan Natarajan
ID: 22905310
i don't think this would help to me?

as i need to retrieve or get the date to display...
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 375 total points
ID: 22905522
It looks like http://wwp.greenwichmeantime.com/time-zone/asia/india/time.htm is doing what you want.  Why not CURL that page?  Or better yet, contact them and ask how they sync the time.
0
 
LVL 36

Author Comment

by:Loganathan Natarajan
ID: 22905613
OK, i shall study on that.

Thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question