Contents
Display Legacy Contents

 Print
    DateTimeDiff  
This Function returns a <string>, which is the date time resultant of the sum between the specified Date Time and Value.

Parameters

Date Time 1 <string>
  Date Time to subtract Date Time 2 from. This parameter must be in format YYYYMMDDHHMISS.
   
Date Time 2 <string>
  Date Time to subtract from Date Time 1. This parameter must be in format YYYYMMDDHHMISS.
   
Return Type <string>
  Unit of Value to return.
The Possible values for this parameter are:

  "S"     Second.
  "M"

Minute.
  "H"

Hour.
  "D"

Day.
  "HHMMSS"     Time.
  "DDHHMMSS"     Date Time.

     
Example 1
  Example 2
DateTimeDiff("20120103091530", "20120103091550", "S")

Result = 20
  DateTimeDiff("20120103091530", "20120103091550", "D")

Result = 0
     
Example 3   Example 4
DateTimeDiff("20120103091550", "20120103091530", "S")

Result = 20
  DateTimeDiff("20120103091530", "20120103091550", "HHMMSS")

Result = 000020

     
  • If the Return Type is a unit greater than the actual difference between Date Time 1 and Date Time 1, the result will be 0
  • If Date Time 1 is later than Date Time 2, the parameters order is inverted in runtime. Therefore, the result of this function will never be preceded by minus sign.

See also
Samples
Sample 1
Sample 2
 
Updated: 3/21/2018 4:31 PM