[Date->SetFormat] sets the output date format for a particular date data type within a Lasso format file. The tag requires one parameter which defines how the date should be formatted.
%D U.S. date format (mm/dd/yyyy).
%Q MySQL date format (yyyy-mm-dd).
%q MySQL timestamp format (yyyymmddhhmmss).
%r 12-hour time format (hh:mm:ss [AM/PM]).
%T 24-hour time format (hh:mm:ss).
%Y 4-digit year.
%y 2-digit year.
%m Month number (1=January, 12=December).
%B Full English month name (e.g. "January").
%b Abbreviated English month name (e.g. "Jan").
%d Day of month (1-31).
%w Day of week (1=Sunday, 7=Saturday).
%W Week of year.
%A Full English weekday name (e.g. "Wednesday").
%a Abbreviated English weekday name (e.g. "Wed").
%H 24-hour time hour (0-23).
%h 12-hour time hour (1-12).
%M Minute (0-59).
%S Second (0-59).
%p AM/PM for 12-hour time.
%z Time zone offset in relation to GMT (e.g. -0800).
%% A percent sign.
By default, all output is zero padded to two characters. For example, 02/03/2002.
A hyphen - between the % and the letter code instructs Lasso not to pad the output. For example, 2/3/2002
An underscore _ between the % and the letter instructs Lasso to pad the output with spaces. For example, 2/ 3/2002.
[(Date)->(SetFormat: 'FormatString')]
The following example sets the date output format to yyyy/mm/dd for a particular date variable.
[Var:'MyDate'=(Date:'8/29/2002')]
[$MyDate->(SetFormat:'%Y/%m/%d')]
[$MyDate]
2002/08/29
Tag Link | [Date->SetFormat] | Category | Date |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 6.0 |
Output Type | None | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft