Time Values in Loftware Enterprise SP
Most time values in Loftware Enterprise™ SP must be entered in milliseconds (ms), and most date/time values are stored in a format called Epoch time The number of seconds since 00:00:00 UTC on 1 January 1970, not including leap seconds.. However, you can use Loftware Enterprise SP to convert date/time values from Epoch time to a human readable format. You can also use Loftware Enterprise SP to retrieve the current date and time in a human readable format.
Time Values
Most time values in Loftware Enterprise SP must be entered in whole milliseconds (ms). The following equivalents may be helpful.
1 second = 1,000ms
1 minute = 60,000ms
1 hour = 3,600,000ms
1 day = 86,400,000ms
To convert a specific value to or from milliseconds, conversion websites such as The Calculator Site may be helpful.
Current Date/Time
You can run a Date/Time data source, a Format Date/Time business rule component block, or a dateTime business rule component to retrieve the current date and time from the Loftware Application Server. The date and time is returned as a value with a data type of STRING (not DATE) in the format specified by the data source or business rule.
A Date/Time data source, a Format Date/Time component block, or a dateTime business rule component can return the current time on the Loftware Application Server in any of the following formats.
Tip: If you are associating a Date/Time data source with a variable text field, ensure that the value of Max Chars (controlled by Chars Per Line and # Lines) for the variable text field is great enough to accommodate the length of the resulting data.
Format | Description | Example |
---|---|---|
ddMMyy |
Date, month number, year |
080512 |
d-MMM |
Date and month name |
8-May |
d-MMM-yy |
Date, month name, year |
8-May-12 |
h:mm |
Hour and minutes |
9:56 |
h:mm AM/PM |
Hour and minutes with AM or PM suffix |
9:56 AM |
h:mm:ss |
Hour, minutes, seconds |
9:56:04 |
h:mm:ss AM/PM |
Hour, minutes, seconds with AM or PM suffix |
9:56:04 PM |
hhmm |
Hour and minutes in 24-hour format |
0956 |
hhmmss |
Hour, minutes, seconds in 24-hour format |
095604 |
M/d/yy |
Month number, date, two-digit year |
5/8/12 |
M/d/yy h:mm |
Month number, date, two-digit year, hour, minutes |
5/8/12 9:56 |
MMddyy |
Month number, two-digit date, two-digit year with no separators |
050812 |
MM/dd/yy h:mm |
Month number, two-digit date, two-digit year, hour, minutes |
05/08/12 9:56 |
MM/dd/yyyy |
Month number, two-digit date, year |
05/08/2012 |
MMddyyyy |
Month number, two-digit date, year with no separators |
05082012 |
MMM-yy |
Month name, two-digit year |
May-12 |
WWyy |
Week of the month and two-digit year with no separator |
0415 |
Custom |
Use the date and time symbols to create a custom data format. Tip: In a Date/Time data source, after entering a custom format in the Format field, click another field to refresh the Date/Time Sample. |
|
Placeholder Characters in Custom Date/Time Formats
You can include static text by enclosing it in single quotation marks. You can include symbols such as a colon, slash, or hyphen without quotation marks.
In general, entering a single placeholder character produces a value including the minimum number of characters required. Using repeated placeholder characters typically specifies the minimum number of characters to use and may produce leading zeros in numeric values.
Tip: If you require a placeholder for the Julian day, Julian date, or ordinal date, use D, which produces the day number of the year.
Placeholder | Description | Number of placeholders to use |
---|---|---|
a |
Period of day, such as AM or PM |
1 or 2 |
D |
Day of year |
1 or 3 |
d |
Day of month |
1 or 2 |
E |
Day of week Note: Use one or three characters to produce a three-character day abbreviation, or four characters to produce the full name of the day. |
1, 3, or 4 |
F |
Day of week in month. For example, if referring to the second Thursday in a month, the F placeholder would produce a value of 2. |
1 |
G |
Era, such as A.D. or B.C. |
1 |
H |
Hour of day using 24-hour format (0-23) |
1 or 2 |
h |
Hour of day using 12-hour format (1-12) |
1 or 2 |
K |
Hour of day using 12-hour format (0-11) |
1 or 2 |
k |
Hour of day using 24-hour format (1-24) |
1 or 2 |
M |
Month of year Note: Use one or two characters to produce the month number, three characters to produce a three-character abbreviation, or four characters to produce the full name of the month. |
1, 2, 3, or 4 |
m |
Minute of hour |
1 or 2 |
S |
Millisecond of second |
1 or 3 |
T |
Shift Code for devices with the Server Family and Loftware Model for the Loftware NiceLabel driver. Shift codes are alphanumeric representations of labor shifts within facilities that can be used for traceability and are configured directly on a device console. Note: The T placeholder can only be used on devices with the Server Family and Loftware Model for the Loftware NiceLabel driver. |
1 |
s |
Second of minute |
1 or 2 |
u |
Day of week using numeric format (1-7), such as 1 (representing Monday). |
1 |
W |
Week of month |
1 |
w |
Week of year |
1 or 2 |
X |
ISO 8601 time zone, such as -04, -0400, or -04:00. Note: Use one character to produce a two-digit time (hours only), two characters to produce a four-digit time with no colon, or three characters to produce a four-digit time including a colon. |
1, 2, or 3 |
y |
Year Note: For a two-digit year, use two characters. Otherwise, a four-digit year is displayed. |
1, 2, or 4 |
Z |
RFC 822 time zone, such as -0400. |
1 or 5 |
z |
General time zone, such as Eastern Standard Time or EST. Note: Use one or three characters to produce a three-character abbreviation, or four characters to produce the full name of the time zone. |
1, 3, or 4 |
Date/Time Values in Data Sources
Most date/time values in Loftware Enterprise SP, including those obtained from a Database data source, are stored in Epoch time The number of seconds since 00:00:00 UTC on 1 January 1970, not including leap seconds.. You can use a Script data source to convert a date/time value from Epoch time to a human readable format. For more information, see Script Examples: Change the Format of a Date.
Date/Time Values in a Rule
In a Map Operations or Static rule, you can select the data type for each value. For a value with a data type of DATE, you can specify the date/time value either in Epoch time or in the following format: yyyy-MM-dd hh:mm:ss.
Date/Time Values in a Business Rule in XML
For most values in a business rule in XML, you can specify the data type of the value. In most cases, one of the possible data types is DATE. For a DATE value, you can specify the date/time value either in Epoch time or in the following format: yyyy-MM-dd hh:mm:ss. In a comparison in a condition, you can use equals, greaterThan, lessThan, and notEquals comparison operators to compare DATE values.