# DateTime Sub

> Kalipso Studio 6.1 documentation · https://doc.sysdevmobile.com/kalipso/6.1/documentation/expressions/functions/date-functions/datetime-sub
>
> DateTimeSub subtracts seconds, minutes, hours, days or a time or date-time value from a date-time string in YYYYMMDDHHMISSCCC format.

This Function returns a _\<string>_, which is the date time resultant of the subtraction between the specified **Date Time** and **Value**.

### Parameters

* **Date Time** _\<string> -_ Date Time to subtract the **Value** from. This parameter must be in format YYYYMMDDHHMISSCCC.
* **Value Unit** _\<string> -_ Unit of **Value** to subtract from **Date Time**. The Possible values for this parameter are:
  * "S" - Second
  * "M" - Minute
  * "H" - Hour
  * "D" - Day
  * "HHMMSS" - Time
  * "DDHHMMSS" - Date Time
* **Value** _\<string> -_ Value to subtract from Date Time. The unit of this parameter depends on the Value Unit.

### **Examples**

* _Example 1_

DateTimeSub("20100301091530000", "D", "1")\
**Result** = 20100228091530000

* _Example 2_

DateTimeAdd("20100301091530000", "HHMMSS", "010000")\
**Result** = 20100301081530
