Data Sheet
dScript
dScript User Manual v2.15
UTC clock
Coordinated Universal Time (UTC) is an international time standard. Your internet connected
module has access to this time by using its UTC port. To use the UTC port add the following in
your dScript header area.
UTCport UTC 0 1
The first parameter (UTC) is the name of the port that you will use in the program to refer to
it. The second is the time zone offset. Here in the UK we want to use GMT so just set this to
zero. Most of Europe are on CET (Central European Time) which is 1 hour ahead of UTC so this
would be set to 1. The time zone offset can include minutes. For example India which is UTC
+5:30 would use:
UTCport UTC 5:30 0
The third parameter is a flag for daylight saving time. This only works for countries that put
the clock forward 1 hour on the last Sunday in March, and back 1 hour on the last Sunday in
October. Set to 0 for UTC or 1 for UTC+daylight saving time.
Accessing the time is done by reading the 7 UTC port variables.
UTC.Year This is 0 - 99. For the year 2015 it will be 15.
UTC.Month 0 - 11 for January to December.
UTC.Day 1 - 31 for the day of the month
UTC.Wday 0 - 6 for Sunday to Saturday.
UTC.Hour 0 - 23
UTC.Minute 0 - 59
UTC.Second 0 - 59
Note that after powering up the module it takes 15-20 seconds to synchronise with internet
time servers, during this time all the above will read zero. The following will display the date
and time on an LCD05.
tcpip.hostname "dS3484"
tcpip.ip "192.168.0.136"
tcpip.mask "255.255.255.0"
tcpip.port 17494
tcpip.dns1 "192.168.0.1"
tcpip.dns2 "8.8.8.8"
tcpip.gateway "192.168.0.1"
serialport LCD05 1 10 90
UTCport UTC 0 1 ; name, TimeZone offset, daylight saving
string s1[100]
string Day[10]
string Month[10]
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
38