Latest News

the latest news from our team

Parse Date Function

The Parse Date function parses text representing a date or timestamp into a Julian timestamp that shows the number of milliseconds since 1/1/1970. The Date format field specifies the format of the text to evaluate. The format options are described in detail here: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

parse-date

One use of this function is to compare dates. Set two variables to the following values:

  • Date1 = 01/04/2017
  • Date2 = 10/11/2016

If you use a Greater Than or Less Than condition to test these dates, Date2 is the greater date because the values are compared as strings: 10 > 01. Comparing these values as dates is easy:

  1. Add a Parse Date function to each variable. These dates are formatted the same way, so the Parse Date function is the same for both variables, MM/dd/yyyy. If your date is represented with a different format, see Date and Time Patterns below for help determining the correct representation for your data.
  2. You can see in the Variables window that these values are converted to a Julian date representation that shows the number of milliseconds since 1 January 1970: 
  3. Date1 and Date2 can now be compared.

More information of how to use the Parse Date function is available at https://minisoft.com/support/index.php/date-calculation-procedure-video-only/.

Parsing dates with “th”, “nd”, “rd”, “st” or other letter combinations

If a date is alphanumeric, use of eFORMz business rules (conditional logic) is likely necessary.

Letters must be escaped by quotes:

‘th,’

Date and Time Patterns

Letter

Date or Time Component

Presentation

Examples

G

Era designator

Text

AD

y

Year

Year

1996; 96

M

Month in year

Month

July; Jul; 07

w

Week in year

Number

27

W

Week in month

Number

2

D

Day in year

Number

189

d

Day in month

Number

10

F

Day of week in month

Number

2

E

Day in week

Text

Tuesday; Tue

a

Am/pm marker

Text

PM

H

Hour in day (0-23)

Number

0

k

Hour in day (1-24)

Number

24

K

Hour in am/pm (0-11)

Number

0

h

Hour in am/pm (1-12)

Number

12

m

Minute in hour

Number

30

s

Second in minute

Number

55

S

Millisecond

Number

978

z

Time zone

General time zone

Pacific Standard Time; PST; GMT-08:00

Z

Time zone

RFC 822 time zone

-0800

X

Time zone

ISO 8601 time zone

-08; -0800; -08:00

Leave a Reply

Your email address will not be published. Required fields are marked *