Quote:
Originally Posted by parayna
Heya ^_^ I am using this Mod (everything works great!) but do you know how I would change the time zone? I am in the UK, see, and it is set in a time zone 5 hours back (so like at 9 my time, it says it was posted at 4, for example)
Thank you ^_^ (I just want it UK time because I am from the UK XD) Also, if there is a way for it to automatically detect a user's time zone and change the times for them that would be great as well! (But I know little about coding so I have no idea how that would be possible...)
|
Glad it's working for you!
You can set the DateTime thingy to your timezone, but I don't think it's possible to set it to the user's timezone. Perhaps with javascript, but I'm not really sure how
Check the file newsview.php inside admincp/view, and search for this part:
PHP Code:
public function create(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle("Create");
if($mysidia->input->post("submit")){
$todayDate = new DateTime;
//add the following line:
$todayDate->setTimezone(new DateTimeZone('Europe/London'));
$date = $todayDate->format('Y-m-d H:i:s');
//rest of the code here
I assumed London, but here's the list of available timezones you can use:
http://php.net/manual/en/timezones.php
I just used it for my country and it's 1 hour behind lol