User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata


This is a reference page for Date, Number, and String formatting.


Date Format

Date as a string, formatted according to a pattern. The pattern is a format that is full of various placeholders that will display different parts of the date. These are case-sensitive! These placeholders can be repeated for a different effect. For example, M will give you 1-12, MM will give you 01-12, MMM will give you Jan-Dec, MMMM will give you January-December.

Functions that use this date formatting include:

Note: The table below demonstrate some common formatting elements for convenience.  Date formatting in Ignition is largely driven by Java's SimpleDateFormat class. See the SimpleDateFormat documentation for more information. 

Symbol

Description

Presentation

Examples

Other Notes

aAm/Pm markerTextPM
DDay in yearNumber189
dDay in monthNumber10
EDay name in weekTextEEEE=Tuesday; E=Tue
FDay of week in monthNumber22nd Sunday of the month
GEra designatorTextG=AD
HHour in day (0-23)Number0
hHour in am/pm (1-12)Number12
kHour in day (1-24)Number24
KHour in am/pm (0-11)Number0
MMonth in yearMonthMMMM=July; MMM=Jul; MM=07
mMinute in hourNumber30
sSecond in minuteNumber55
SMillisecondNumber978
uDay number of weekNumber1(1 = Monday, ..., 7 = Sunday)
wWeek in yearNumber27If Dec31 is mid-week, it will be in week 1 of the next year
WWeek in monthNumber2
XTime zoneISO 8601 time zoneX=-08; XX=-0800; XXX=-08:00
yYearYearyyyy=1996; yy=96Lowercase y is the most commonly used year symbol
YWeek yearYearYYYY=2009; YY=09Capital Y gives the year based on weeks (ie. changes to the new year up to a week early)
zTime zoneGeneral time zonezzzz=Pacific Standard Time; z=PST
ZTime zoneRFC 822 time zoneZ=-0800


Number Format

Returns a string version of the number argument, formatted as specified by the pattern string. This is commonly used to specify the number of decimal places to display, but can be used for more advanced formatting as well. The pattern string is a numeric format string, which may include any of these characters that instruct it how to format the number. 

Functions that use this number formatting include:


Note: The tables below demonstrate some common formatting elements for convenience.  Number formatting in Ignition is largely driven by Java's DecimalFormat class. See the DecimalFormat documentation for more information. 

Symbol

Description

0Specifies a required digit.

#

Specifies an optional digit.

,

The grouping separator.

.The decimal separator.

-

A minus sign.

EScientific notation.
;Used to separate positive and negative patterns. The negative subpattern will only be used to specify the prefix and suffix. The number of digits, , minimal digits, and other characteristics are all the same as the positive pattern.
%Multiplies the value by 100 and shows as a percent.
'Used to quote special characters.

Example

This table shows some numbers, and the result of using various format strings to format them.

Number

Pattern

Result

5

0

5

5

0.0

5.0

5

00.0

05.0

123

#,##0

123

1024

#,##0

1,024

1337

#,##0.#

1,337

1337.57

#,##0.#

1,337.6

87.32

#,##0.0000

87.3200

-1234

#,##0

-1,234

-1234

#,##0;(#)

(1,234)

4096

0.###E0

4.096E3

.348

#.00%

34.80%

34.8

#0.00'%'

34.80%


String Format 

Functions that use this data formatting include:


Note: The tables below demonstrate some common formatting elements for convenience.  String formatting in Ignition is largely driven by Java's Formatter class. See the Formatter documentation for more information. 

Date/Time Formatting Elements

Date/Time Formatting Element Suffix

Description

'H'Hour of the day for the 24-hour clock, formatted as two digits with a leading zero where necessary, i.e., 00 - 23.
'I'Hour of the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e., 01 - 12.
'k'Hour of the day for the 24-hour clock, i.e., 0-24.
'k'Hour of the 12-hour clock, i.e., 1 - 12.
'M'Minute within the hour formatted as two digits with a leading zero where necessary, i.e., 00 - 59.
'S'Seconds within a minute, formatted as two digits with a leading zero where necessary, i.e., 00 - 59.
'L'Millisecond within the second formatted as three digits with leading zeros as necessary, i.e., 000-999.
'B'Locale-specific full month name i.e. "January", "March".
'b'Locale-specific abbreviated month name i.e. "Jan", "Mar".
'A'Full name of the day of the week i.e. "Monday".
'a'Abbreviated name of the day of the week i.e. "Mon".
'Y'Year formatted as a 4 digit numeric value with leading zeros where necessary i.e. 0005 would be the year 5 in the Gregorian calendar. 
'y'Last two digits of the year formatted with leading zeros where necessary.
'j'Day of the year formatted as three digits with leading zeros where necessary, i.e., 001 - 366 for the Gregorian calendar. 
'm'Month, formatted as a two digit number with leading zeros where necessary, i.e., 01-13.
'd'Day of the month formatted as two digit number with leading zeros where necessary, i.e,. 00 - 31.
'e'Day of the month formatted as two digits, i.e., 0-31. 

Formatting Elements

Element Character

Data Type to Substitute Element Character

Description

'b', 'B'BooleanIf the corresponding argument arg is NULL, then a False is substituted into the format string. If arg is boolean, then the string conversion of arg will be substituted into the format string. For every other condition, True is substituted into the format string. 
's', 'S'StringThe string value arg is substituted into the formatted sting. 
'c', 'C'CharacterThe unicode value arg is substituted into the formatted string. 
'd'IntegralThe decimal value arg is substituted into the formatted string. 
'f'Floating PointThe floating point value arg is substituted into the formatted string. 
't', 'T'Date/TimeThis is the prefix for date/time arg values to be used for string formatting. 



  • No labels