SBM ModScript Reference → Programming SBM ModScript → Object Types → TimeT → TimeT Add() Method
Adds or subtracts to date using TimeZone rules (to subtract use negative values).
void Add( TimeZone tz, int years, int months int days, int hours, int minutes, int seconds )
Parameter | Type | Description |
---|---|---|
tz |
TimeZone |
The time zone used to determine the point in time represented by the text. If not provided, the current user's timezone is used. |
years |
int |
The number of years to add or subtract from the current date. (Use negative values to subtract). |
months |
int |
The number of months to add or subtract from the current date. (Use negative values to subtract). |
days |
int |
The number of days to add or subtract from the current date. (Use negative values to subtract). |
hours |
int |
The number of hours to add or subtract from the current date. (Use negative values to subtract). |
minutes |
int |
The number of minutes to add or subtract from the current date. (Use negative values to subtract). |
seconds |
int |
The number of seconds to add or subtract from the current date. (Use negative values to subtract). |
Type | Description |
---|---|
None |
SBM ModScript version: 11.3.
var t = TimeT(1545721199ll); t.Add( CreateTimeZone("MST"), -1, 0, 0, 1, -60, 1 ); Ext.WriteStream( t.FormatDateText( "EEEE, MMMM d, yyyy h:mm:ss a z" ) );
Result:
Monday, December 25, 2017 12:00:00 AM MST
None.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.