Page 1 of 1

Why strtotime giving me wrong time??

Posted: Wed Sep 11, 2013 6:33 am
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.!

Re: Why strtotime giving me wrong time??

Posted: Wed Sep 11, 2013 1:20 pm
by requinix
What's your code?

Re: Why strtotime giving me wrong time??

Posted: Thu Sep 12, 2013 12:16 am
by Ankush
i am converting like this-
date_default_timezone_set('Asia/Kolkata');
$timestamp=strtotime("some date and time");

Re: Why strtotime giving me wrong time??

Posted: Thu Sep 12, 2013 3:02 am
by requinix
That's what your code looks like. What is your actual code?