主要内容

DateTime Data Type Converter

R2026b

Convert time points or storage data types of DateTime signal

Since R2026b

  • DateTime Data Type Converter block icon

Libraries:
Simulink / DateTime

Description

The DateTime Data Type Converter block converts the time point or storage data types, of a DateTime signal. To convert between time standards, use the DateTime Time Standard Converter block.

Examples

expand all

This example shows how the DateTime Data Type Converter block modifies the stored value of a DateTime signal without changing its calendar representation. The block's input is a DateTime signal that represents 12:00 AM UTC on January 1, 2000. The input signal's Time point is Seconds since Unix epoch and its stored value is the number of UTC seconds since 12:00 AM on January 1, 1970. The block's output is a DateTime signal representing the same instant, but with Time point set to Seconds since TAI epoch. The stored value of the output signal is the number of UTC seconds since 12:00 AM TAI on January 1, 1958, which is 378691210 seconds earlier than the UNIX epoch.

model='ex_datetime_data_type_converter_block';
load_system(model)
sim(model);
open_system(model)

Ports

Input

expand all

DateTime signal, specified as a scalar.

Output

expand all

DateTime signal with converted time point or storage data type, returned as a scalar.

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.

Select the time point:

  • Seconds since Unix epoch

  • Seconds since NTP epoch

  • Seconds since TAI epoch

  • Julian date

  • Modified Julian date

  • J2000.0 date

For more information on storage type constraints, see Simulink.DateTimeType.

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)

For more information on storage type constraints, see Simulink.DateTimeType.

Block Characteristics

Data Types

Boolean | bus | datetime

Direct Feedthrough

yes

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2026b