Note: Nintex Apps data centers are located in West US and Australia (AUS). In-region processing of Nintex Apps data is only available in these regions.

Note: 

All code samples below refer to the skuid object.

In the v2 API, this object is not directly accessible when working within a browser console—or when referring to another Nintex Apps page runtime.

If you are experiencing issues, use the skuid.runtime API to target the appropriate page context.

skuid.time

Nintex Apps's date and datetime strings are always expressed using UTC and follow ISO 8601 formatting conventions:

  • Dates: yyyy-MM-dd
  • DateTimes: yyyy-MM-dd'T'HH:mm:ss[.SSS]'Z'

Though the Apex primitive DateTime supports milliseconds (and thus they are included in Salesforce DateTime strings), the milliseconds portion of the DateTime is reset to ".000" when the value is stored in the database. Nintex Apps will, likewise, discard milliseconds when converting to and from JavaScript Dates. For this reason, the millisecond portion of the string will always be included when the string is generated by Nintex Apps, but will be ignored if provided as an input.

In addition, Nintex Apps does not support arbitrary time zone conversions. All Salesforce DateTime strings are assumed to be using UTC ("+0000"). If another time zone is specified, it will be ignored and the date will be parsed as if it were in UTC. Nintex Apps will, however, perform the proper conversion between UTC and the user's local time when converting JavaScript dates to/from Salesforce DateTime strings.

(The date formats above conform to the Java Simple Date Format )

Functions

skuid.time.formatDate(formatString,jsDate)

Formats a JavaScript Date object (jsDate) into a string value, according to a designated date format.

formatString can include any of the following date format pattern characters, as well as any desired separator characters.

The formatting algorithm is jQuery's $.datepicker.formatDate(), whose format characters are based on Java's SimpleDateFormat.

DATE FORMAT PATTERN CHARACTERS:

  • d - day of month (no leading zero)
  • dd - day of month (two digit)
  • o - day of the year (no leading zeros)
  • oo - day of the year (three digit)
  • D - day name short
  • DD - day name long
  • m - month of year (no leading zero)
  • mm - month of year (two digit)
  • M - month name short
  • MM - month name long
  • y - year (two digit)
  • yy - year (four digit)
Arguments: Returns: Return type:
  • formatString ( string ) -- A String containing one or more format pattern characters and any other desired separator characters, e.g. "m/d/yy", "DD, MM d, yy"
  • jsDate ( date ) -- A JavaScript Date object to format

The Date formatted according to the desired format, e.g. "11/23/1961", "Thursday, November 23, 1961"

String

skuid.time.formatTime(formatString,jsDate)

Formats a JavaScript Date object (jsDate) into a string value, according to a designated time format.

formatString can include any of the following time format pattern characters, as well as any desired separator characters.

The format characters are based on Java's SimpleDateFormat.

TIME FORMAT PATTERN CHARACTERS:

  • a - Am/pm marker, localized according to running user's locale
  • s - second(s) in minute
  • m - minute in hour
  • H - hour in day (0-23)
  • k - hour in day (1-24)
  • h - hour in am/pm (1-12)
  • K - hour in am/pm (0-11)

Note:  mm , hh , HH , kk , KK will result in leading zeros being prepended if the result is less than 10.

Arguments: Returns: Return type:
  • formatString ( string ) -- A String containing one or more time format pattern characters and any other desired separator characters, e.g. "HH:mm:ss", "h:mm a"
  • jsDate ( date ) -- A JavaScript Date object to format

The Date formatted according to the desired time format, e.g. "18:45:02", "6:45 pm"

String

skuid.time.getLocalDateTime(jsDate)

Use this function to offset your date by the amount that the Salesforce user timezone setting and the user's device timezone differ. When you use this function, your date will now be "wrong" if you output it into the console. This is because after applying this function, the timezone will not change, but the actual date and time will be offset. In most cases, this function will return the exact same date that was input. To reverse the result of this function, use the skuid.time.getRealJSDateTimeFromLocal( jsDate ) function.

Arguments: Returns: Return type:
  • jsDate ( date ) -- A JavaScript Date object

The offset JavaScript date value

Date

skuid.time.getRealJSDateTimeFromLocal(jsDate)

Use this function to reverse the effects of the skuid.time.getLocalDateTime( jsDate ) function.

Arguments: Returns: Return type:
  • jsDate ( date ) -- A JavaScript Date object

The offset JavaScript date value

Date

skuid.time.getSFDate(jsDate)

Takes a JavaScript Date Object and converts it to a Salesforce Date string

Arguments: Returns: Return type:
  • jsDate ( date ) -- A JavaScript Date object

The corresponding Salesforce date string

String

skuid.time.getSFDateTime(jsDate)

Takes a JavaScript Date object and converts it to a Salesforce DateTime string

Arguments: Returns: Return type:
  • jsDate ( date ) -- A JavaScript Date object

The corresponding Salesforce DateTime string

String

skuid.time.makeFormattedDate(sfDate)

Takes a Salesforce Date string and formats it in the locale of the running Salesforce user

Arguments: Returns: Return type:
  • sfDate ( string ) -- A Salesforce date string

A date formatted using the current client's locale

String

skuid.time.makeFormattedDateFromJS(jsDate)

Takes a JavaScript Date object and formats it in the locale of the running Salesforce user

Arguments: Returns: Return type:
  • jsDate ( date ) -- A JavaScript Date object

A date formatted using the current client's locale

String

skuid.time.parseSFDate(sfDate)

Takes a Salesforce Date string and converts it to a JavaScript Date object

Arguments: Returns: Return type:
  • sfDate ( string ) -- A Salesforce date string

The corresponding JavaScript Date object

Date

skuid.time.parseSFDateTime(sfDateTime)

Takes a Salesforce DateTime string and converts it to a JavaScript Date object

Arguments: Returns: Return type:
  • sfDate ( string ) -- A Salesforce date string

The corresponding JavaScript Date object

Date

skuid.time.setUserTimeZone(timeZoneKey)

Adjusts the Nintex Apps UI to render Dates, Datetimes, and Calendars in the specified Time Zone.

Arguments: Returns: Return type:

Promise, resolved once the UI has been re-rendered to display content in the desired Time Zone.

Promise

Properties

Property Type Required Description
skuid.time.amPm Unknown Type No

An array containing the AM and PM markers—localized according to the running user's language setting or the designated language for the page—in lowercase. For example, if the running user's language is "en-US", this array will be ["am","pm"] .

Nintex Apps only ships with AM and PM markers in English - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called AM PM Markers.
skuid.time.dayNames Unknown Type No

An array of full-length day name Strings, localized according to the running user's language setting or the designated language for the page. For example, if the running user's language is "en-US", this array will be ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] .

Nintex Apps ships with localized full-length day names for English, Spanish, French, and Swedish - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called Day Names Long.
skuid.time.dayNamesMin Unknown Type No

An array of 2-character day name Strings, localized according to the running user's language setting or the designated language for the page. For example, if the running user's language is "en-US", this array will be ["Su","Mo","Tu","We","Th","Fr","Sa"] .

Nintex Apps ships with localized 2-character day names for English, Spanish, French, and Swedish - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called Day Names Min.
skuid.time.dayNamesShort Unknown Type No

An array of 3-character day name Strings, localized according to the running user's language setting or the designated language for the page. For example, if the running user's language is "en-US", this array will be ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"] .

Nintex Apps ships with localized 3-character day names for English, Spanish, French, and Swedish - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called Day Names Short.
skuid.time.monthNames Unknown Type No

An array of month name Strings, localized according to the running user's language setting or the designated language for the page. For example, if the running user's language is "en-US", this array will be ["January","February", ... , "December"] .

Nintex Apps ships with localized month names for English, Spanish, French, and Swedish - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called Month Names Long.
skuid.time.monthNamesShort Unknown Type No

An array of abbreviated month name Strings, localized according to the running user's language setting or the designated language for the page. For example, if the running user's language is "en-US", this array will be ["Jan","Feb", ... , "Dec"] .

Nintex Apps ships with localized abbreviated month names for English, Spanish, French, and Swedish - but you can add translations for any other languages you need by navigating to Setup > Custom Labels in Salesforce Setup, and searching for the Custom Label included in the Nintex Apps namespace called Month Names Short.