Why strtotime giving me wrong time??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ankush
Forum Newbie
Posts: 10
Joined: Thu Sep 05, 2013 12:22 am

Why strtotime giving me wrong time??

Post by Ankush »

Hello everyone
i am here to ask you a small thing but i stuck with this.
The problem is i want to convert current date time to timestamp because of application need.
I am doing this with strtotime().
It is giving me accurate day and date but not giving proper time.I am from India. So do i need to set time zone. and i have also set date_default_timezone_set('Asia/Kolkata');
but this is also not working.
I am hoping for some quick solution.
Thank you very much in advance.!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Why strtotime giving me wrong time??

Post by requinix »

What's your code?
Ankush
Forum Newbie
Posts: 10
Joined: Thu Sep 05, 2013 12:22 am

Re: Why strtotime giving me wrong time??

Post by Ankush »

i am converting like this-
date_default_timezone_set('Asia/Kolkata');
$timestamp=strtotime("some date and time");
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Why strtotime giving me wrong time??

Post by requinix »

That's what your code looks like. What is your actual code?
Post Reply