Date functions
A date can be specified either with four digits for the year, two digits for the month, and two digits for the day or with two digits for the year, two digits for the month, and two digits for the day.
For text-type data, specify data with forward slashes between each value, such as YYYY/MM/DD or YY/MM/DD.
For date-type data, specify data with the year, month, and day in a row, such as YYYYMMDD or YYMMDD.
Restriction
To use text-type data for date-type arguments in date functions, the data type must be converted using CTOD.
"SEI2WA", "SEI2WA1", "SEI2WA1Z", "WA2SEI", "NENGO", and "WYEAR" can only be used in Japanese forms.
"DATE", "IDATE", and "WA2SEI" do not support two-digit years.
Function name | Feature |
---|---|
Converts date-type data (YYYYMMDD) into text-type data (YYYY/MM/DD). | |
Retrieves the system date. | |
Retrieves the system date. | |
Converts text-type data (YYYY/MM/DD) into date-type data (YYYYMMDD). | |
Retrieves the name of the day of the week as text-type data from date-type data (YYYYMMDD). | |
Adds (or subtracts) the specified number of days to (or from) a date, and retrieves the result as date-type data (YYYYMMDD). | |
Retrieves only the Western calendar year as numeric-type data from date-type data (YYYYMMDD). | |
Retrieves only the Japanese calendar year as numeric-type data from date-type data (YYYYMMDD). | |
Retrieves only the month as numeric-type data from date-type data (YYYYMMDD). | |
Retrieves only the month as text-type data from date-type data (YYYYMMDD). | |
Retrieves only the day as numeric-type data from date-type data (YYYYMMDD). | |
Calculates the day of the week from date-type data (YYYYMMDD) and retrieves the corresponding numeric-type data. | |
Calculates the number of days within the period and retrieves the result as numeric-type data. | |
Converts the Western calendar date-type data to the Japanese calendar date, and retrieves the result as text-type data. | |
Converts the Japanese calendar text-type data to the Western calendar date, and retrieves the result as date-type data. | |
Retrieves the Era name of the Japanese calendar (era) from Western calendar date-type data. |
DTOC
Feature | Converts date-type data (YYYYMMDD) into text-type data (YYYY/MM/DD). |
---|---|
Format | DTOC(date_data) |
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
DATE
Feature | Retrieves the system date. |
---|---|
Format | DATE() |
Settings | This will retrieve the system date at the time of printing (when the DATE function is executed) as date-type data (YYYYMMDD). |
Usage examples |
|
IDATE
Feature | Retrieves the system date. |
---|---|
Format | IDATE() |
Settings | This will retrieve the system date at the time of printing (when the VrInit function is executed) as date-type data (YYYYMMDD). |
Usage examples | ReferenceSpecify this function if you want to output the same printing date on all of the pages in the same spool data.
|
CTOD
Feature | Converts text-type data (YYYY/MM/DD) into date-type data (YYYYMMDD). |
---|---|
Format | CTOD(string_or_character_field_name) |
Settings |
|
Usage examples | Prerequisite Text-type data "2005/01/10" is entered in the text field "S1"
|
CDOW
Feature | Retrieves the name of the day of the week as text-type data from date-type data (YYYYMMDD). |
---|---|
Format | CDOW(date_data) |
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
ADATE
Feature | Adds (or subtracts) the specified number of days to (or from) a date, and retrieves the result as date-type data (YYYYMMDD). |
---|---|
Format | ADATE(date_data,numeric_data) |
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
YEAR
Feature | Retrieves only the Western calendar year as numeric-type data from date-type data (YYYYMMDD). |
---|---|
Format | YEAR(date_data) |
Settings |
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. |
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
WYEAR
Feature | Retrieves only the Japanese calendar year as numeric-type data from date-type data (YYYYMMDD). |
---|---|
Format | WYEAR(date_data) |
Settings |
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. |
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
MONTH
Feature | Retrieves only the month as numeric-type data from date-type data (YYYYMMDD). |
---|---|
Format | MONTH(date_data) |
Settings |
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. |
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
MONTH2
Feature | Retrieves only the month as text-type data from date-type data (YYYYMMDD). |
---|---|
Format | MONTH2(date_data) |
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
DAY
Feature | Retrieves only the day as numeric-type data from date-type data (YYYYMMDD). |
---|---|
Format | DAY(date_data) |
Settings |
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. |
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
DOW
Feature | Calculates the day of the week from date-type data (YYYYMMDD) and retrieves the corresponding numeric-type data. | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Format | DOW(date_data) | ||||||||||||||
Settings |
ReferenceThe numeric values corresponding to the day of the week are as follows:
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. | ||||||||||||||
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
CDATE
Feature | Calculates the number of days within the period and retrieves the result as numeric-type data. |
---|---|
Format | CDATE(date_data1,date_data2) |
Settings |
CautionBecause the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result. |
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
ReferenceIf 2005/01/10 is specified as Date1 and 2005/12/31 is specified as Date2, the number of days passed is retrieved as a negative value since Date2 is subtracted from Date1. If you want to retrieve 355 for the number of days passed as a positive value, specify CDATE("2005/12/31","2005/01/10"). |
SEI2WA / SEI2WA1 / SEI2WA1Z
Feature | Converts the Western calendar date-type data to the Japanese calendar date, and retrieves the result as text-type data. |
---|
Reference
The five Japanese calendar eras available for conversion are as follows: 明治 (Meiji), 大正 (Taisho), 昭和 (Showa), 平成 (Heisei), and 令和 (Reiwa).
The following four Western calendar date formats can be used for conversion:
2005/01/10
Text-type data
20050110
Date-type data
05/01/10
Text-type data in which "/" is entered between the Western calendar Year (two digits), Month (two digits), and Date (two digits)
050110
Date-type data in which the Western calendar Year (two digits), Month (two digits), and Date (two digits) are entered as consecutive digits
SEI2WA
Format | SEI2WA(date_data) |
---|---|
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
SEI2WA1
Format | SEI2WA1(date_data) |
---|---|
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
SEI2WA1Z
Format | SEI2WA1Z(date_data) |
---|---|
Settings |
|
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|
WA2SEI
Feature | Converts the Japanese calendar text-type data to the Western calendar date, and retrieves the result as date-type data. |
---|---|
Format | WA2SEI(Japanese_era_string) |
Settings |
Reference
|
Usage examples | Prerequisite Date-type data "H
|
NENGO
Feature | Retrieves the Era name of the Japanese calendar (era) from Western calendar date-type data. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Format | NENGO(date_data) | ||||||||
Settings |
Reference
| ||||||||
Usage examples | Prerequisite Date-type data "20050110" is entered in the text field "S1"
|