Home » HTPC » How to fix OpenELEC incorrect time on Raspberry Pi 1 and 2?

How to fix OpenELEC incorrect time on Raspberry Pi 1 and 2?

While OpenELEC is an awesome media center OS for Raspberry Pi, it does come with one minor flaw: incorrect time. This post shows how to fix OpenELEC incorrect time on Raspberry Pi. If you have not yet tried OpenELEC then I strongly suggest you install OpenELEC on Raspberry Pi and give it a try. In my recent comparison of OpenELEC with Xbian and Raspbmc, OpenELEC was the clear winner with ease of installation, speed, and performance. Without further delay, let me show you how to fix the OpenELEC incorrect time problem and set Kodi Timezone.

Build a Low-Cost Raspberry Pi Media Center ~$65 Price
Raspberry Pi 3 (RPi3) Model B Quad-Core 1.2 GHz 1 GB RAM Kit, including: ~$49.99
Samsung 16GB EVO Class 10 Micro SDHC Card with Adapter ~$6.99
SANOXY Wireless USB PC Remote Control Mouse for PC ~$8.00

Fix for OpenELEC Incorrect Time Issue

The main reason for OpenELEC showing wrong time on Raspberry Pi is the lack of real clock on Raspberry Pi board. Because of this you may have to change time on Raspberry Pi every time after boot. There are two ways to fix the incorrect time shown in OpenELEC on Raspberry Pi. You will need an active internet connection for these fixes to work.

OpenELEC Incorrect Time
OpenELEC Incorrect Time

Method 1: SSH and Commandline

The first way is using commandline and SSH. While some may find this inconvenient many have found this to be sure-shot. To fix OpenELEC’s time problem, SSH into your Raspberry Pi running OpenELEC (ensure that SSH is enabled on your Raspberry Pi. If you do not know how to SSH into Raspberry Pi, then check this guide.

SSH into your OpenELEC using the username “root” and password “openelec” and edit /storage/.config/autostart.sh file.

nano /storage/.config/autostart.sh

Add the following content to the file:

#!/bin/sh
(sleep 30; \
/usr/sbin/ntpdate pool.ntp.org; \
)&

Save and exit. Assign execute privileges to the file using the following command:

chmod +x /storage/.config/autostart.sh

Your OpenELEC incorrect time issue should be fixed after the next reboot. You may have to wait 30 seconds before time updates after booting. What the autostart script does is it automatically sets the time from the timeserver everytime during boot. [Read: How to run OpenELEC from USB Stick?]

Method 2: Using Kodi Interface

Upadate (4/25/2015): This method has been confirmed to work on Raspberry Pi 2 running OpenELEC.

For many novice Linux / commandline users this might be an easier method as everything is done through the XBMC interface. Navigate to Settings -> Appearance -> International and set Kodi / XBMC time zone for your location as shown in the picture below.

Set Time Zone in OpenELEC
Set Time Zone in OpenELEC

In addition, you may have to set the time server in OpenELEC settings (as shown in the video below, I did not have to do this). Go to System -> OpenELEC -> Network and click on Timeserver #1. Enter pool.ntp.org and click Done. As soon as you set it, time should automatically correct itself. Watch this method in action in the video below.

Set OpenELEC Time on Raspberry Pi 1 and 2

After setting the correct time on OpenELEC, I have rebooted my Raspberry Pi multiple times and the Kodi timezone stayed intact. This may or may not work for you but you will lose nothing but a couple minutes in trying this out.

So there you go. If this or some other method worked for you please leave a comment and share with others. Hopefully, one of these methods fixes your OpenELEC incorrect time issue.

We Are Hiring: Familiar with Media Streaming, HTPC, Home Server, Smart Home, and Home Automation topics? Write about it and earn money. No writing experience needed. APPLY HERE.

Get 20% OFF with IPVanish VPN:

♦   Hide your browsing and streaming activity: No logs and no tracking
♦   Access geo-restricted content from anywhere
♦   Encrypt and anonymize: Kodi, Plex, Downloads, Personal Info
♦   Windows, Mac, Linux, Android, iOS, Router, and more.
♦   Money back guarantee - Sign Up Now

About the author

Anand

Anand is a self-learned computer enthusiast, a part-time blogger, and a Food Scientist by career. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs on htpcbeginner.com and smarthomebeginner.com.