Skip to content

Instantly share code, notes, and snippets.

@svagionitis
Last active December 20, 2015 12:18
Show Gist options
  • Save svagionitis/6129436 to your computer and use it in GitHub Desktop.
Save svagionitis/6129436 to your computer and use it in GitHub Desktop.
Update UTC time using TDT and/or TOT
<div class="wsd" wsd_style="vs2010"><pre>
title Update Time
participant irisplayer
participant app
note left of irisplayer: receive the TDT and/or TOT tables
alt TOT exists
note right of irisplayer: parse TOT and get UTC and local time offset
alt received UTC - current UTC in [5,10]
note right of irisplayer: update UTC
irisplayer -> app: UTC updated
else received UTC - current UTC NOT in [5,10]
note right of irisplayer: don't update UTC
end
irisplayer -> app: local time offset
note right of app: set local time offset and store in persistent storage
else TOT does't exist
note right of irisplayer: parse TDT and get UTC
alt received UTC - current UTC in [5,10]
note right of irisplayer: update UTC
irisplayer -> app: UTC updated
else received UTC - current UTC NOT in [5,10]
note right of irisplayer: don't update UTC
end
irisplayer -> app: Not valid value for local time offset
note right of app: the local time offset is set by the application by prompting the user.
end
</pre></div><script type="text/javascript" src="http://www.websequencediagrams.com/service.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment