Contenu principal

DateTime Clock

Output current simulation calendar date and time as DateTime data type

Since R2024b

  • DateTime Clock block icon

Description

The DateTime Clock block outputs the current simulation calendar date and time as DateTime data type. Specify characteristics such as time point, storage data type, and time standard.

Use these other DateTime blocks to interact with the DateTime Clock block.

DescriptionBlock

Convert time points, storage data types, or time points and storage data types, of DateTime signal.

DateTime Data Type Converter

Convert between DateTime time standards.

DateTime Time Standard Converter

Convert DateTime to calendar time format.

DateTime to Calendar Time

Extract value of DateTime input signal.

DateTime to Epoch Time

Convert epoch time to DateTime.

Epoch Time to DateTime

Convert DateTime signal data type to formatted string.

DateTime to Formatted String

Time Standards

Collectively, the DateTime blocks support these time standards:

  • International Atomic Time (TAI) — Atomic time based on the International System of Units (SI) second computed and reported by scientific laboratories. TAI has no leap seconds.

  • Coordinated Universal Time (UTC) — Atomic time computed by subtracting a particular number of leap seconds from TAI. Leap seconds keep UTC as close to Universal Time as possible while still ticking at the rate specified by TAI.

  • Terrestrial Time (TT) — Time standard that astronomers use to tag measurements taken at the Earth surface. TT is 32.184 seconds ahead of TAI.

  • Barycentric Dynamical Time (TDB ) — Time standard that astronomers use to tag planetary ephemerides (positional data).

Limitations

The DateTime blocks are available only as an internal feature with early access. Their design is subject to change.

Ports

Output

expand all

Simulation calendar date and time of selected DateTime Clock block, returned as a scalar DateTime signal.

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Specification

Specify the current clock time point as Seconds since Unix epoch, Seconds since NTP epoch, Seconds since TAI epoch, Julian date, Modified Julian date, or J2000.0 date. The DateTime Clock block uses this value to determine the clock epoch.

The Seconds since Unix epoch, Seconds since NTP epoch, and Seconds since TAI epoch options describe time elapsed since a universal instant in time. The Julian date, Modified Julian date, and J2000.0 date options are the number of days elapsed since their respective epochs.

Time PointEpoch

Seconds since Unix epoch

1970-01-01T00:00:00 UTC

Seconds since NTP epoch

1900-01-01T00:00:00 UTC

Seconds since TAI epoch

1958-01-01T00:00:00 TAI

Julian date

4714 BC-11-24T12:00:00

Modified Julian date

1858-11-17T00:00:00

J2000.0 date

2000-01-01T12:00:00

Dependencies

To change the current clock epoch, select a different Time point value.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: TimePoint
Values: Seconds since Unix epoch (default) | Seconds since NTP epoch | Seconds since TAI epoch | Julian date | Modified Julian date | J2000.0 date

Current clock epoch as determined by the time point. The Seconds since Unix epoch, Seconds since NTP epoch, and Seconds since TAI epoch describe time elapsed since a universal instant in time. The Julian date, Modified Julian date, and J2000.0 date options are the number of days elapsed since their respective epochs.

EpochTime Point

1970-01-01T00:00:00 UTC

Seconds since Unix epoch

1900-01-01T00:00:00 UTC

Seconds since NTP epoch

1958-01-01T00:00:00 TAI

Seconds since TAI epoch

4714 BC-11-24T12:00:00

Julian date

1858-11-17T00:00:00

Modified Julian date

2000-01-01T12:00:00

J2000.0 date

Dependencies

To change the current clock epoch, select a different Time point value.

Select the DateTime storage data type:

  • double

  • int32

  • uint32

  • fixdt(0,64,32)

  • fixdt(1,64,32)

  • fixdt(0,128,64)

  • fixdt(1,128,64)

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: StorageDataType
Values: double (default) | int32 | uint32 | fixdt(0,64,32) | fixdt(1,64,32) | fixdt(0,128,64) | fixdt(1,128,64)

Specify the diagnostic for when clock rolls over its storage data type maximum value as None, Warning, or Error.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: DiagnosticForClockRollOver
Values: None (default) | Warning | Error

Specify the time interval between samples.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: SampleTime
Values: 0 (default) | scalar | vector

Select to enable zero-crossing detection. For more information, see Zero-Crossing Detection.

Programmatic Use

Parameter: ZeroCross
Type: character vector, string
Values: 'on' | 'off'
Default: 'on'

Time Standard

Specify the current clock time standard:

  • TAI — International Atomic Time

  • UTC — Coordinated Universal Time

  • TT — Terrestrial Time

The DateTime Clock block cannot generate time in TDB (Barycentric Dynamical Time).

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: TimeStandard
Values: TAI (default) | UTC | TT

Select this option when you need the DateTime Clock block to use a leap second table for the clock.

Dependencies

To enable this parameter, set the Time standard parameter to UTC.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: UseLeapSecondTable
Values: off (default) | on

Specify the accumulated leap seconds as a nonnegative scalar integer between 0 and 16,056, inclusive. If you do not want to specify a leap second table, specify the accumulated leap seconds until the current simulation time. This setting assumes no further leap seconds occur.

Dependencies

To enable this parameter:

  • Set the Time standard parameter to UTC.

  • Clear the Use leap second table parameter.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: AccumulatedLeapSeconds
Values: off (default) | on
Data Types: double

Specify the leap second table as a semicolon-separated list of dates containing historical and predicted leap seconds or -1. To edit an existing table entry or add a new row, edit the parameter entry. For each row:

Leap second table entries, specified as an N-by-3 array of integers. In each row:

  • First entry is a year.

  • Second entry is 1 if a positive leap second occurs on June 30 of that year, -1 if a negative leap second occurs on that day, and 0 otherwise.

  • Second entry is 1 if a positive leap second occurs on December 31 of that year, -1 if a negative leap second occurs on that day, and 0 otherwise.

To add a new table entry, click Add Row.

Dependencies

To enable this parameter:

  • Set the Time standard parameter to UTC.

  • Select the Use leap second table parameter.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: LeapSecondTable
Values: [1972, 1, 1; 1973, 0, 1; 1974, 0, 1; 1975, 0, 1; 1976, 0, 1; 1977, 0, 1; 1978, 0, 1; 1979, 0, 1; 1981, 1, 0; 1982, 1, 0; 1983, 1, 0; 1985, 1, 0; 1987, 0, 1; 1989, 0, 1; 1990, 0, 1; 1992, 1, 0; 1993, 1, 0; 1994, 1, 0; 1995, 0, 1; 1997, 1, 0; 1998, 0, 1; 2005, 0, 1; 2008, 0, 1; 2012, 1, 0; 2015, 1, 0; 2016, 0, 1] (default) | -1 | semicolon-separated list of dates

Version History

Introduced in R2024b