SBM ModScript Reference → Programming SBM ModScript → Object Types → TimeMillis → TimeMillis 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, int millis )
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). |
millis |
int |
The number of milliseconds to add or subtract from the current date. (Use negative values to subtract). |
Type | Description |
---|---|
None |
SBM ModScript version: 11.4.
var t = TimeMillis(1545721199999ll); t.Add( CreateTimeZone("MST"), -1, 0, 0, 1, -60, 0, 1 ); Ext.WriteStream( t.FormatDateText( "EEEE, MMMM d, yyyy h:mm:ss:SSS a z" ) );
Result:
Monday, December 25, 2017 12:00:00:000 AM MST
None.
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.