Additional information about date and time patterns
The Date processor allows you to apply operations on dates following specific date and time patterns.
Let's take the following input date and datetime format as an example: 7/22/2015 and 7/22/2015 6:33:01 (here this time is in AM).
What should be the date pattern set in the Date processor configuration?
-
M is used to describe months with one or two digits.
Example: 7/22/2015 or 07/22/2015
-
MM is used to describe months with two digits.
Example: 07/22/2015 is valid, but 7/22/2015 is not.
-
MMM is used to describe the abbreviated month names.
Example: Jul
-
MMMM is used to describe full month names.
Example: July
-
d is used to describe days with one or two digits.
Example: 7/22/2015 or 7/2/2015
-
d is used to describe days with two digits.
Example: 7/22/2015 is valid, but 07/2/2015 is not.
-
yyyy is used to describe the year.Information noteNote: The capital letter Y is used for week years.
Example: 7/22/2015
-
H is used to describe hours in a day (0-23) with one or two
digits. If you want to use hours in a day (1-24), use
k.
Example: 7/22/2015 6:33:01 or 07/22/2015 18:33:01
-
HH is used to describe hours in a day (0-23) with two
digits.
Example: 7/22/2015 18:33:01 is valid, but 07/22/2015 6:33:01 is not.
-
h is used to describe hours in AM/PM (1-12) with one or two
digits. If you want to use hours in AM/PM (0-11), use
K.
Example: 7/22/2015 6:33:01 or 07/22/2015 06:33:01
-
hh is used to describe hours in AM/PM (1-12) with two
digits.
Example: 7/22/2015 06:33:01 is valid, but 07/22/2015 6:33:01 is not.
-
m is used to describe minutes with one or two
digits.
Example: 7/22/2015 6:3:01 or 7/22/2015 6:33:01
-
mm is used to describe minutes with two digits.
Example: 7/22/2015 6:33:01 is valid, but 7/22/2015 6:3:01 is not.
-
s is used to describe seconds with one or two
digits.
Example: 7/22/2015 6:33:1 or 7/22/2015 6:33:01
-
ss is used to describe seconds with two digits.
Example: 7/22/2015 6:33:01 is valid, but 7/22/2015 06:33:1 is not.
- M/d/yyyy
- M/dd/yyyy
- M/d/yyyy h:m:s
- M/d/yyyy h:mm:s
- M/d/yyyy h:mm:ss
- M/d/yyyy h:m:ss
For more information on date and time formats, see the official Java documentation.