|
<< Click to Display Table of Contents >> Manual > Appendix > Date and time format > Date and time format (user format) |
About user formats
This page explains the specifications regarding the "user format" of the date and time format.
In the user format, users can add their own formats by registering the format settings in the DateTimeFormatConf root property.
In addition, by overriding the system default format (@DATETIME) or ISO format (@ISO) in the user format definition, you can freely customize the behavior of default formats such as @DATETIME.
|
User formats cannot be specified from Server Script 2 (SC2). |
User format specifications
■ Basic specifications
[@datetime format name]
Property name = Setting value
...
First, when defining a user format, enclose the date and time format name in [ ]. The format name written within [ ] must begin with "@".
Then, after the line that defines the date and time format name, write the property = setting value on each line.
If you want to add multiple formats, you can create a new section in [ ] and define them one after the other.
[@datetime format name 1] Property name = Setting value ...
[@datetime format name 2] Property name = Setting value ...
|
For details about the properties that can be specified in the date and time format, see "Date and time format property format".
Setting example (DateTimeFormatConf root property)
For reference, here is an example of setting the DateTimeFormatConf property.
■Example of setting using the Format property
After Format=, write according to the format for the Format property.
[@SAMPLE01] Format=%Y/%m/%d %H:%M:%S |
In addition, when defining the Format property, options cannot be specified when using it. (@SAMPLE01.D, etc. cannot be specified.)
■Example of setting using Base property
After Base=, write according to the format for the Base property.
[@SAMPLE02] Base=y-m-d H:M:S |
When defining the Base property, you can specify options when using it (e.g. @SAMPLE02.D).
■ Example of setting multiple date and time formats
If you want to add multiple formats, you can write them consecutively like this:
[@SAMPLE01] Format=%Y/%m/%d %H:%M:%S TimeZone=US Eastern Standard Time
[@SAMPLE02] Base=y-m-d H:M:S |
■ Example of customizing the system format "@ISO"
You can override the system format by defining a datetime format name with the same name as the system format "@ISO".
As an example, here, after Base=, write according to the format for the Base property.
[@ISO] Base=y/m/d H:M:S |
Using the above example settings, if you specify "@ISO" as the date and time format, "2017-02-18 02:59:45" will become "2017/02/18 02:59:45".
■ Example of customizing the system format "@DATETIME"
You can override the system format by defining a datetime format name with the same name as the system format "@DATETIME".
As an example, let's write it as follows.
[@DATETIME] All=@LOCALE AM=am. PM=pm. |
In the above example, after inheriting all properties from @LOCALE, only the AM and PM properties are changed.
Furthermore, by setting the above example, if you specify the date and time format as "@DATETIME.DT.%p", "2017/02/18 02:59:45 PM" will become "2017/02/18 02:59:45 pm.".
|
The system formats "@ISO" and "@DATETIME" are defined internally as follows:
[@ISO] Base=y-m-d H:M:S
[@DATETIME] All=@LOCALE
|