Official Content

Returns the seconds elapsed between two DateTime data type values.

Syntax

TDiff(DateTime-expression1 , DateTime-expression2)

Where:

DateTime-expression1 , DateTime-expression2:  
     Are valid expressions that can involve constants, functions, methods, variables, attributesProceduresInline Formulas.
     Both results must match the DateTime data type or Data data type.   

Type Returned:
Numeric

Scope

Objects: Procedure, Transaction, Web Panel, Panel, Data Provider
Generators: .NET, .NET Framework, Java, Apple, Android, Angular

Description

Returns the seconds elapsed between the two DateTime values received as parameters (DateTime-expression1 - DateTime-expression2).
DateTime-expression2 can be greater than DateTime-expression1. In this case, a negative value is returned.

Notes:

  • If the arguments support Milliseconds, the resulting numeric value contains decimals that represent the milliseconds.
  • This function calculates the time difference even when any of the parameters have null values.

Samples

&Diff = TDiff(&LastTime, Now())

&Diff = TDiff(&VarFinalDateTime, &VarInitialDateTime)

See Also


  


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant