Post about your Basic project here

Moderator: Mmiscool

User avatar
By Rotohammer
#34564 I've added an ntpdate command that will fetch the current time and date from the net. Its based on https://github.com/sandeepmistry/esp826 ... Client.ino .

Now to figure out the best way to return the data into variables. I'm thinking about adding a subcommand to tell it what to return, like:

Code: Select allntpdate var fulldate 
would set var to "Wed 11 18 2015 05:32:08"

Code: Select allntpdate var dow 
would set var to "Wed"

Code: Select allntpdate var time 
would set var to " 05:32:08"

Code: Select allntpdate var secs 
would set var to "8"

I'll implement this unless someone devises a better idea.
User avatar
By Mmiscool
#34578 This would be good to implement as a function.

Would also need a command to set the time zone.

bla = time()
bla = date()

or some thing similar.
User avatar
By Rotohammer
#34617 A function would be cool, especially for things like :

Code: Select allif date(dow) == "Sat" then ...


So I will go that route. This way theres not a lot of string ops that have to be done on the BASIC side in order to pick apart the time/date into vars.