Maybe some of these suggestions might do the trick.
source:
https://stackoverflow.com/questions/25374570/how-to-update-date-and-time-of-raspberry-pi-with-out-internetRemember that Raspberry Pi does not have real time clock. So even you are connected to internet have to set the time every time you power on or restart.
This is how it works:
Type sudo raspi-config in the Raspberry Pi command line
Internationalization options
Change Time Zone
Select geographical area
Select city or region
Reboot your pi
Next thing you can set time using this command
sudo date -s "Mon Aug 12 20:14:11 UTC 2014"
More about data and time
man date
When Pi is connected to computer should have to manually set data and time
What I did was,
1. I install meinberg ntp software application
http://www.satsignal.eu/ntp/setup.html on windows 7 pc. (softros ntp server is also possible.)
2. change raspberry pi ntp.conf file (for auto update date and time)
server xxx.xxx.xxx.xxx iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
3. If you want to make sure that date and time update at startup run this python script in rpi,
import os
try:
client = ntplib.NTPClient()
response = client.request('xxx.xxx.xxx.xxx', version=4)
print "===================================="
print "Offset : "+str(response.offset)
print "Version : "+str(response.version)
print "Date Time : "+str(ctime(response.tx_time))
print "Leap : "+str(ntplib.leap_to_text(response.leap))
print "Root Delay : "+str(response.root_delay)
print "Ref Id : "+str(ntplib.ref_id_to_text(response.ref_id))
os.system("sudo date -s '"+str(ctime(response.tx_time))+"'")
print "===================================="
except:
os.system("sudo date")
print "NTP Server Down Date Time NOT Set At The Startup"
pass
Many more suggestions are available on the pi forum
https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=84723