|
This macro converts the date field passed as a parameter with an input format to another field with an output format.
Check below the list of parameters for this macro and the accepted values.
| Parameter |
Values |
Description |
|
field_name
|
Example of how the parameter should be informed: {field_name}
|
This parameter must receive the name of the data field that will have the manipulated value |
input_format |
The string must have the same format used in the database.
Example of how to enter the date string in the macro: "yyyy-mm-dd"
Accepted values:
- Date string - For example "yyyy-dd-mm"
- db_Format - Retrieves the date format from the database.
|
Receives the string with the current date format, saved in the database.
If the format informed is different from the one used in the database, the macro will not work as expected.
|
output_format |
The String must have the format in which the date will be displayed.
Example of how to enter the date string in the macro: "yyyy/dd/mm/"
Accepted options
- Date string - For example "yyyy-dd-mm"
- sc_format_region - Value formatted according to the regional configuration
- db_Format - Convert the date to the database's native value
|
Receive the string with the desired date display format.
If you want to use the format according to the regional configuration, the value sc_format_region in this parameter must be informed
|
For more information on the data strings consult the PHP Manual
Ex. 1: Converts the date from"dd/mm/yyyy" format to the "yyyymmdd" format.
{field_date} = sc_date_conv({field_date}, "dd/mm/aaaa", "aaaammdd");
Ex. 2: Converts the date from the database native format to "dd/mm/yyyy" format.
{field_date} = sc_date_conv({field_date}, "db_format", "dd/mm/aaaa");
Ex. 3: Converts the date from the "dd/mm/yyyy" format to the Database native format(db_format).
{field_date} = sc_date_conv({field_date}, "dd/mm/aaaa", "db_format");
Ex. 4: Converting the date from the database's native format (db_format) to the regional setting format (sc_format_region)
{field_date} = sc_date_conv({field_date},"db_format","sc_format_region");
Ex. 5: Converting the date from the "yyyy-mm-dd" to the regional Setting format (sc_format_region)
{field_date} = sc_date_conv({field_date},"aaaa-mm-dd","sc_format_region");
|