Calculate Julian date or modified Julian date
Aerospace Blockset / Utilities / Unit Conversions
The Julian Date Conversion block converts the specified date to the Julian date or modified Julian date.
This block is valid for all common era (CE) dates in the Gregorian calendar.
The calculation of Julian date does not take into account leap seconds.
day
— Clock sourceClock source for model simulation, specified as a scalar or array.
The presence and label of this port depends on the Time increment parameter.
Port | Time increment Setting |
---|---|
day |
|
hour |
|
min |
|
sec |
|
No inport port |
|
Data Types: double
JD
— Julian dateJulian date, returned as a scalar or array.
Data Types: double
Year
— Year2013
(default) | double, whole number, greater than 1Year, specified as a scalar, to calculate the Julian date.
Block Parameter:
year |
Type: character vector |
Values: double, greater than 1 |
Default:
'2013' |
Month
— MonthJanuary
(default) | February
| March
| April
| May
| June
| July
| August
| September
| October
| November
| December
Month to calculate the Julian date. From the list, select the month from
January
to
December
.
Block Parameter:
month |
Type: character vector |
Values:
'January' | 'February' |
'March' | 'April' |
'May' | 'June' |
'July' | 'August' |
'September' | 'October' |
'November' |
'December' |
Default:
'January' |
Day
— Day1
(default) | 2
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| 23
| 24
| 25
| 26
| 27
| 28
| 29
| 30
| 31
Day to calculate the Julian date. From the list, select the day from
1
to 31
.
Block Parameter:
day |
Type: character vector |
Values: '1'
| '2' | '3' |
'4' | '5' |
'5' | '6' |
'7' | '8' |
'9' | '10' |
'11' | '12' |
'13' | '14' |
'15' | '16' |
'17' | '18' |
'19' | '20' |
'21' | '22' |
'23' | '24' |
'25' | '26' |
'27' | '28' |
'29' | '30' |
'31' |
Default:
'1' |
Hour
— Hour0
(default) | double, whole number, 0
to
24
Hour used to calculate the Julian date. Enter a value from
0
to 24
.
Block Parameter:
hour |
Type: character vector |
Values: double, whole number,
0 to 24 |
Default:
'0' |
Minutes
— Minutes0
(default) | double, whole number, 0
to
60
Minutes to calculate the Julian date. Enter a number from
0
to 60
.
Block Parameter:
min |
Type: character vector |
Values: double, whole number,
0 to 60 |
Default:
'0' |
Seconds
— Seconds0
(default) | double, whole number, 0
to
60
Specify the seconds used to calculate the Julian date. Enter a number from
0
to 60
.
Block Parameter:
sec |
Type: character vector |
Values: double, whole number,
0 to 60 |
Default:
'0' |
Calculate modified Julian date
— Modified Julian dataoff
(default) | on
Select this check box to calculate the modified Julian date (MJD) for corresponding elements of the year, month, day, hour, minute, and second.
Selecting this check box changes the output port label to MJD. Clearing this check box changes the output port label to JD.
Block Parameter:
modflag |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Time increment
— Time incrementDay
(default) | Hour
| Min
| Sec
| None
Time increment between the specified date and the desired model simulation
time. The block adjusts the calculated Julian date to take into account the
time increment from model simulation. For example, selecting
Day
and connecting a simulation timer to the port
means that each time increment unit is one day and the block adjusts its
calculation based on that simulation time.
If you select None
, the calculated Julian date does not
take into account the model simulation time. Selecting this option removes
the first block input.
This parameter controls the presence and label of output port.
Time increment Setting | Port |
---|---|
| day |
| hour |
| min |
| sec |
| No inport port |
Block Parameter:
deltaT |
Type: character vector |
Values:
'Day' | 'Hour' |
'Min' | 'Sec' |
'None' |
Default:
'Day' |
Action for out-of-range input
— Out-of-range block behaviorNone
(default) | Warning
| Error
Out-of-range block behavior, specified as follows.
Action | Description |
---|---|
| No action. |
| Warning in the MATLAB® Command Window, model simulation continues. |
| MATLAB returns an exception, model simulation stops. |
Block Parameter:
errorflag |
Type: character vector |
Values:
'None' | 'Warning' |
'Error' |
Default:
'Error' |