Contenuto principale

Simulink.DateTimeType

R2026b

Specify DateTime data type properties for Simulink signals

Since R2026b

Description

A Simulink.DateTimeType object specifies the time point, time standard, and storage data type for a DateTime signal in a Simulink® model. Simulink blocks might use Simulink.DateTimeType objects to define output DateTime data types.

Creation

Description

DateTime = Simulink.DateTimeType returns a Simulink.DateTimeType object with default property values.

example

DateTime = Simulink.DateTimeType(Name=Value) returns a Simulink.DateTimeType object with property values specified by one or more name-value arguments.

example

DateTime = Simulink.DateTimeType(datetimeTypeName) returns a Simulink.DateTimeType object created from a compact type name string. datetimeTypeName is a character vector of the form 'datetime_<timeUnit><epoch><timeStandard>_storageDataType'. Construct the string by concatenating the time unit, epoch, and time standard (no separators between them), bracketed by underscores separating the datetime prefix and the storage data type suffix.

  • timeUnit is:

    • 's' (seconds)

    • 'j' (days for Julian-based time points)

  • epoch is:

    • 'u' (UNIX®)

    • 'n' (NTP)

    • 't' (TAI)

    • 'j' (Julian)

    • 'm' (Modified Julian)

    • '2' (J2000.0)

  • timeStandard is:

    • 't' (TAI)

    • 'u' (UTC)

    • 'd' (TT)

  • storageDataType is:

    • 'double'

    • 'int32'

    • 'uint32'

    • 'sfix128_En64'

    • 'ufix128_En64'

    • 'sfix64_En32'

    • 'ufix64_En32'

example

Input Arguments

expand all

DateTime character vector string, specified as a compact name string. The name has the format: 'datetime_<timeUnit><epoch><timeStandard>_storageDataType', bracketed by underscores separating the datetime prefix and the storage data type suffix.

Name-Value Arguments

expand all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: TimePoint='Modified Julian date'

Time reference point for the DateTime signal, specified as one of these values.

ValueEpoch
'Seconds since Unix epoch' (default)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

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

Example: TimePoint='Modified Julian date'

Dependencies

  • When TimePoint is Julian date, Modified Julian date, or J2000.0 date, StorageDataType must be double.

  • When TimePoint is Seconds since NTP epoch, StorageDataType must be fixdt(1,64,32), fixdt(0,64,32), fixdt(1,128,64), or fixdt(0,128,64).

Data Types: char | string

Time standard for the DateTime signal, specified as one of these values.

ValueDescription
'TAI' (default)International Atomic Time. Atomic time based on the International System of Units (SI) second. TAI has no leap seconds.
'UTC'Coordinated Universal Time. Atomic time equal to TAI minus a particular number of leap seconds.
'TT'Terrestrial Time. Time standard for Earth-surface measurements in astronomy. TT is 32.184 seconds ahead of TAI.

Example: TimeStandard='UTC'

Dependencies

When TimeStandard is TT, StorageDataType must be double, fixdt(1,64,32), fixdt(0,64,32), fixdt(1,128,64), or fixdt(0,128,64).

Data Types: char | string

Storage data type for the numeric representation of the DateTime signal, specified as one of these values.

  • 'double' — 64-bit double-precision floating point

  • 'int32' — 32-bit signed integer

  • 'uint32' — 32-bit unsigned integer

  • 'fixdt(1,64,32)' — 64-bit signed fixed point with 32 fractional bits

  • 'fixdt(0,64,32)' — 64-bit unsigned fixed point with 32 fractional bits

  • 'fixdt(1,128,64)' — 128-bit signed fixed point with 64 fractional bits

  • 'fixdt(0,128,64)' — 128-bit unsigned fixed point with 64 fractional bits

Note

Setting StorageDataType to 'fixdt(1,64,32)', 'fixdt(0,64,32)', 'fixdt(1,128,64)', or 'fixdt(0,128,64)' requires a Fixed-Point Designer™ license.

Example: StorageDataType='fixdt(1,64,32)'

Dependencies

When StorageDataType is TT, StorageDataType must be double, fixdt(1,64,32), fixdt(0,64,32), fixdt(1,128,64), or fixdt(0,128,64).

Data Types: char | string

Properties

expand all

Time reference point for the DateTime signal, specified as one of these values:

ValueEpoch
'Seconds since Unix epoch' (default)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

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

Data Types: char | string

Time standard for the DateTime signal, specified as one of these values.

ValueDescription
'TAI' (default)International Atomic Time. Atomic time based on the International System of Units (SI) second. TAI has no leap seconds.
'UTC'Coordinated Universal Time. Atomic time equal to TAI minus a particular number of leap seconds.
'TT'Terrestrial Time. Time standard for Earth-surface measurements in astronomy. TT is 32.184 seconds ahead of TAI.

Data Types: char | string

Storage data type for the numeric representation of the DateTime signal, specified as one of the following values:

  • 'double' — 64-bit double-precision floating point.

  • 'int32' — 32-bit signed integer.

  • 'uint32' — 32-bit unsigned integer.

  • 'fixdt(1,64,32)' — 64-bit signed fixed point with 32 fractional bits.

  • 'fixdt(0,64,32)' — 64-bit unsigned fixed point with 32 fractional bits.

  • 'fixdt(1,128,64)' — 128-bit signed fixed point with 64 fractional bits.

  • 'fixdt(0,128,64)' — 128-bit unsigned fixed point with 64 fractional bits.

Data Types: char | string

Examples

collapse all

Create a Simulink.DateTimeType object with default property values.

DateTime = Simulink.DateTimeType;
DateTime = 

  DateTimeType with properties:

        Description: ''
          TimePoint: 'Seconds since Unix epoch'
    StorageDataType: 'double'
       TimeStandard: 'TAI'

Create a Simulink.DateTimeType object and specify the time point, time standard, and storage data type using name-value arguments.

DateTime = Simulink.DateTimeType(TimePoint='Julian date', ...
     TimeStandard='UTC',StorageDataType='double')
DateTime = 

  DateTimeType with properties:

        Description: ''
          TimePoint: 'Julian date'
    StorageDataType: 'double'
       TimeStandard: 'UTC'

Create a Simulink.DateTimeType object from a compact type name string.

Create a DateTime type with seconds since TAI epoch, TAI time standard, and uint32 storage data type.

DateTime = Simulink.DateTimeType('datetime_stt_uint32')
DateTime = 

  DateTimeType with properties:

        Description: ''
          TimePoint: 'Seconds since TAI epoch'
    StorageDataType: 'uint32'
       TimeStandard: 'TAI'

Version History

Introduced in R2026b