-->
Page 1 of 1

time() does not return current time

PostPosted: Wed Jan 18, 2017 4:08 am
by samlewis02
time() does not return current time. It returns Coordinated Universal Time (UTC), Thursday, 1 January 1970

Re: time() does not return current time

PostPosted: Wed Jan 18, 2017 10:01 pm
by heckler
hi samie,

Two possible reasons come to mind...

1. you did not allow a period of time to pass between the timesetup() command and the time() command. Not sure what the correct amount of delay is but I use a delay 1000.

2. the other possibility is that the module is not connected to a network that has access to the internet. If the module is in AP mode then it will not have access to an NTP time server.

hope this helps
dwight