Session 15: Swift CG+: Clocks

Preparation

Please view details in the Materials tab that contain vital syntax examples for the formatting of clocks for this tutorial.

Description

This video tutorial looks at basic Clocks Swift CG+.

Session specific objectives

  1. Adding Clock nodes to text nodes
  2. How to display the standard system clock time in Absolute time
  3. Using format string syntax for displaying system clock information in Absolute time
  4. Using offsets for clocks in Absolute time
  5. Using count up and countdown clocks in Relative time
  6. How to use a Difference clock to calculate the time of a future event

Chapter 1: Absolute Clocks

  • Text and fonts
  • Set to Running
  • Clock Types and drop-down options

Chapter 2: Formatting Absolute Clock display information

  • Using format syntax
  • Days of the week, month and year information
  • AM and PM options
  • 12 and 24 hour options

Chapter 3: Relative Clocks for count ups and countdowns

  • Setting the Start and End Times
  • Count Down and Stop At End Time options

Chapter 4: Offsets

  • Using offsets in Inputs

Chapter 5: Difference Clocks

  • How to calculate the time of a future event and display it

Expected duration

45 mins

User Level

Advanced users

The new format uses % to specify elements. For example, %Y/%M/%D would give 2022/1/26. Numbers can be padded out by adding a letter followed by a number. For example, %02h will give 04. The following modifiers are recognised:

  • U - uppercase variation of day and month names
  • L - lowercase variation of day and month names
  • % - %
  • a - abbreviated name of day
  • A - name of day
  • b - abbreviated name of month
  • B - name of month
  • p - am/pm
  • P - AM/PM
  • o - st/nd/rd/th
  • O - ST/ND/RD/TH
  • Y - year
  • M - month
  • D - day of month
  • h - hour in 24 hour format
  • H - hour in 12 hour format
  • m - minute
  • s - second
  • z - millisecond

The names of the days and months - including abbreviations - are:

  • Mon, Tue, Wed, Thu, Fri, Sat, Sun
  • Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
  • Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
  • January, February, March, April, May, June, July, August, September, October, November, December

Clock format examples that you can copy and paste from here for use in this video tutorial:

  • A year, month, day clock: %Y/%M/%D
  • A day, month and year clock: %A %D%o %B %Y
  • An abbreviated day, month and year clock: %a %D%o %b %Y
  • A 12 hour time-of-day with todays day clock: %2H:%m:%s