Format Date

Overview

Takes a date represented in any format and reformats it.

Example

For example. Say you have a file that contains dates in the US date format: 11/23/2018. PayGate needs the date in the UK format dd/mm/yyyy. Using the Date Format node you can easily reformat the date into the desired format.

InUse

In the above example the date output from the JSON importer provides the date from the file in mm/dd/yyyy format.

This is fed into the ‘Format Date’ node. This node has been configured as follows:

InUse

In the Start Format text box you tell Paygate about the format of the string as it enters the Date Format node. In this example the incoming date is in US format and we we tell Paygate about this by entering MM/DD/YYYY

In the ‘End Format’ textbox you tell Paygate how you want the date formatted as it leaves the node.

Template tokens

The template determines the format that the date will be created. This allows you to create a dates such as 23/12/19 or 12/23/2019 or just about any other date or time format you might need.

Tokens are used to represent the part of a date or time. For example, the token YYYY represent a four digit year.

Date Tokens

Token Description Example
YYYY or yyyy 4 digit year 2018
YY or yy 2 digit year 18
MM Month number 01, 12
M Month number 1, 12
DD or dd Day of month 01, 21, 31
D or d Day of month 1, 21, 31
Do Day of month with ordinal 1st, 3rd
DDD or ddd Day of year 5, 23, 245
DDDD or dddd Day of year 005, 023, 245
W Week of year (ISO) 1, 26
WW Week of year (ISO) 01, 26
w Week of year 1, 26
ww Week of year 01, 26

Time Tokens

Token Description Example
H Hours (24 hour time) 1, 17
HH Hours (24 hour time) 01, 17
h Hours (12 hour time) 1, 5
hh Hours (12 hour time) 01, 05, 11
a Post or ante meridiem am, pm
A Post or ante meridiem AM, PM
m Minutes 1, 26
mm Minutes 01, 26
s Seconds 3, 48
ss Seconds 03, 48
S millseconds 1, 10, 245
SS millseconds 01, 10, 245
SSS millseconds 001, 010, 245