SAGA 9.12.0 | Tool Library Documentation

Date and Time Difference


Description

This tool converts various date and time formats into other date and time formats.

Supported input types:

SpecifierReplaced by
%HNumber of Hours
%MNumber of Minutes
%SNumber of Seconds
%lNumber of Milliseconds
%DNumber of Days
%ENumber of Weeks
%%The percent character

Note that, for example, the number of hours in the description above is not well defined: it can be either the total number of hours (for example, for a time span of 50 hours this would be 50) or just the hour part of the time span, which would be 2 in this case as 50 hours is equal to 2 days and 2 hours.wxTimeSpan resolves this ambiguity in the following way: if there had been, indeed, the D format specified preceding the H, then it is interpreted as 2. Otherwise, it is 50. The same applies to all other format specifiers: if they follow a specifier of larger unit, only the rest part is taken, otherwise the full value is used.


Parameters

 NameTypeIdentifierDescriptionConstraints
InputTabletable, inputTABLE--
OutputOutputtable, output, optionalOUTPUT--
OptionsTimepoint Fieldtable fieldFIELD_TIMEPOINT--
TimepointFormat choiceFORMAT_TIMEPOINT-Available Choices: [0] Set Date [1] Set Date and Time [2] SAGA Date Field Type [3] Julian Day Number (JDN) [4] Modified Julian Day Number (MJD) [5] Unix Timestamp Default: 0
Timepoint Datedate [GUI]DATE_TIMEPOINT-Default: 2026-04-09
Timepoint Timetext [GUI]TIME_TIMEPOINT-Default: 12:40:39
Timepoint ISO Timetext [CMD]ISOTIME_TIMEPOINT-Default: 2026-04-09T12:40:39
Subtrahent Fieldtable fieldFIELD_SUBTRAHENT--
SubtrahentFormat choiceFORMAT_SUBTRAHENT-Available Choices: [0] Set Date [1] Set Date and Time [2] SAGA Date Field Type [3] Julian Day Number (JDN) [4] Modified Julian Day Number (MJD) [5] Unix Timestamp Default: 0
Subtrahent Datedate [GUI]DATE_SUBTRAHENT-Default: 2026-04-09
Subtrahent Timetext [GUI]TIME_SUBTRAHENT-Default: 12:40:39
Subtrahent ISO Timetext [CMD]ISOTIME_SUBTRAHENT-Default: 2026-04-09T12:40:39
Output aschoiceOUTPUT_AS-Available Choices: [0] Format [1] Weeks [2] Days [3] Hours [4] Minutes [5] Seconds [6] Milliseconds Default: 0
Format StringtextFORMAT_STRING--
Make Timespan AbsolutebooleanABSOLUTE-Default: 0

Command Line


Usage: saga_cmd table_tools 30 [-TABLE ] [-FIELD_TIMEPOINT ] [-FORMAT_TIMEPOINT ] [-ISOTIME_TIMEPOINT ] [-FIELD_SUBTRAHENT ] [-FORMAT_SUBTRAHENT ] [-ISOTIME_SUBTRAHENT ] [-OUTPUT ] [-OUTPUT_AS ] [-FORMAT_STRING ] [-ABSOLUTE ]
  -TABLE:                Table
	table, input
  -FIELD_TIMEPOINT:      Timepoint Field
	table field
  -FORMAT_TIMEPOINT:     TimepointFormat 
	choice
	Available Choices:
	[0] Set Date
	[1] Set Date and Time
	[2] SAGA Date Field Type
	[3] Julian Day Number (JDN)
	[4] Modified Julian Day Number (MJD)
	[5] Unix Timestamp
	Default: 0
  -ISOTIME_TIMEPOINT:    Timepoint ISO Time
	text
[CMD]
	Default: 2026-04-09T12:40:39
  -FIELD_SUBTRAHENT:     Subtrahent Field
	table field
  -FORMAT_SUBTRAHENT:    SubtrahentFormat 
	choice
	Available Choices:
	[0] Set Date
	[1] Set Date and Time
	[2] SAGA Date Field Type
	[3] Julian Day Number (JDN)
	[4] Modified Julian Day Number (MJD)
	[5] Unix Timestamp
	Default: 0
  -ISOTIME_SUBTRAHENT:   Subtrahent ISO Time
	text
[CMD]
	Default: 2026-04-09T12:40:39
  -OUTPUT:               Output
	table, output, optional
  -OUTPUT_AS:            Output as
	choice
	Available Choices:
	[0] Format
	[1] Weeks
	[2] Days
	[3] Hours
	[4] Minutes
	[5] Seconds
	[6] Milliseconds
	Default: 0
  -FORMAT_STRING:        Format String
	text
  -ABSOLUTE:             Make Timespan Absolute
	boolean
	Default: 0