0

I am using a cakephp application.I want to get current time of Eastern timezone (EST) in my timepicker- now(). How would I achieve that.

I have set the default timezone in config/bootstrap.php as:

date_default_timezone_set('US/Eastern');
Configure::write('TimeZone', 'US/Eastern');

Time-picker used : jQuery Timepicker Addon By: Trent Richardson [http://trentrichardson.com] Cakephp Version : CakePHP 2.2.1

I have tried above code, its showing the EST time (UTC - 0500) when i echo the current time in php but when i alert the current time in the script it alerts the (UTC+05:30) time.

Please help me to solve this...

Cliff_Cleet
  • 201
  • 1
  • 3
  • 14
  • Read this, https://stackoverflow.com/questions/15141762/how-to-initialize-javascript-date-to-a-particular-timezone – Talk2Nit Jan 08 '18 at 05:55
  • What timepicker? How are you using it? Please always include the relevant code in your question! Also please always mention your _exact_ CakePHP version (last line in `vendor/cakephp/cakephp/VERSION.txt` or `lib/Cake/VERSION.txt`) - thanks! – ndm Jan 08 '18 at 15:12
  • `0.2.9` isn't the version that you are using, it's the value of the `@since` tag, which is _not_ the _last line_ in the mentioned files. Also as mentioned please include the relevant code that shows how you are using the picker / passing the value to it. – ndm Jan 09 '18 at 11:37

0 Answers0