Date/Time Format

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Actions > Common settings for actions >

Date/Time Format

Date Format

The date format is a convenient function that allows you to dynamically specify names by adding the date and time to file names, folder names, database field names, etc. This function allows you to specify not only fixed names set during development, but also folder names for processing dates, for example.

 

 

■ As a file name

■ As a folder name

c_action_0229

c_action_0230

■ As a name (such as a database field name)


c_action_0231

 

 

First, specify the name in the "File name," "Folder name," and "Name" fields. If you simply want to specify a fixed name, uncheck "Add date." If you want to add the date to the name, check "Add date" and specify the "Date format" and "Relative time." The date and time will then be automatically added to the end of the name. For file names and folder names, the date and time will be added before the extension (for example, .txt). For "Relative time," specify the time or date and time based on the present in the "Relative time format." For information on relative time formats, see "Relative time format".

 

The date format can be specified as follows:

 

example)

%Y%m%d

20160101

%Y%m%d%H%M%S

20160101000000

%Y_%m_%d

2016_01_01

%Y_%m_%d_%H_%_M_%S

2016_01_01_00_00_00

 

 

format

Commentary

%Y

Year in four digits (0100-9999)

%y

The last two digits of the year (00-99)

%#y

Last two digits of the year without leading zeros (0-99)

%m

Two-digit month (01-12)

%d

Day of the month as a two-digit number (01-31)

%p, %#p

AM/PM for morning/afternoon

%I

Two-digit hour in 12-hour format (01-12)

%H

Two-digit hour in 24-hour format (00-23)

%M

Minute in two digits (00-59)

%S

Second in two digits (00-59)

 

 

Relative Time Format

Relative time format is a method of specifying a time relative to the current time, such as one day later or one hour later.

 

Example: If the current date is "2016/01/15 12:12:12" (Friday)

now

Refers to the present.

"2016/01/15 12:12:12"

now-1d

It refers to the current day minus 1.

"2016/01/14 12:12:12"

now+1d

It means now +1 day.

"2016/01/16 12:12:12"

now-1mo

It refers to the current - 1 month.

"2015/12/15 12:12:12"

month

It refers to the beginning of the current month.

"2016/01/01 00:00:00"

month-1d

Refers to the last day of the previous month.

"2015/12/31 00:00:00"

month-1d+9h

It refers to 9:00 a.m. on the last day of the previous month.

"2015/12/31 09:00:00"

day-1d

It refers to yesterday.

"2016/01/14 00:00:00"

day+8h+30m

It means 8:30 today.

"2016/01/15 08:30:00"

week+2d

It refers to this Tuesday.

"2016/01/12 00:00:00"

 

The relative time format is as follows:

 

Reference time [+time interval] [-time interval]...

 

The following base times can be specified in the base time section of the above format.

 

Reference time

Commentary

If the current time is "2016/06/15 12:12:12" (Wednesday),

now

the current

2016/06/15 12:12:12

year

this year

2016/01/01 00:00:00

month

this month

2016/06/01 00:00:00

week

this week

2016/06/12 00:00:00

day

today

2016/06/15 00:00:00

hour

Current time (valid until 12:00)

2016/06/15 12:00:00

minute

Current time (valid down to the minute)

2016/06/15 12:12:00

 

A time interval must be preceded by a "+" or "-" and a number. "+" means future, and "-" means past. For example, "+10m" means 10 minutes after the reference time.

 

Time Interval

Commentary

y

year

d

day

mo

month

w

week

h

time

m

Minutes

s

Seconds

 

 

attention

If the current date is the 31st, you cannot use a relative time that includes subtracting months from NOW (e.g. NOW-1MO, etc.). This is because if the month before the 31st has only 30 days, an error will occur because there is no corresponding day.