Difference between revisions of "SET DATEFORMAT"

From Lianjapedia
Jump to: navigation, search
(Created page with "''Under construction'' ==Purpose== Determine input and output date formats ==Syntax== SET DATEFORMAT [TO] AMERICAN | ANSI | BRITISH | DMY | FORMAT <cISOlocale> | FRENCH | GER...")
 
Line 1: Line 1:
''Under construction''
 
 
==Purpose==
 
==Purpose==
Determine input and output date formats
+
Determine UI date formats for datetextbox formitems and grid columns
  
 
==Syntax==
 
==Syntax==
SET DATEFORMAT [TO] AMERICAN | ANSI | BRITISH | DMY | FORMAT <cISOlocale> | FRENCH | GERMAN | ISO | ITALIAN | JAPAN |  LOCALE | MDY | USA | YMD
+
SET DATEFORMAT ON | OFF | (<expL>)
 +
 
 +
SET DATEFORMAT TO <expC>
  
 
==See Also==
 
==See Also==
[[CTOD()]], [[DATE()]], [[DMY()]], [[DTOC()]], [[DTOS()]], [[DTOV()]], [[LOCALE()]], [[MDY()]], [[SET CENTURY]], [[SET DATE]], [[SET EPOCH]], [[SET MARK]], [[STOD()]], [[VTOD()]]
+
[[Advanced Canvas Control Attributes]], [[Canvas Section Attributes]], [[CTOD()]], [[DATE()]], [[DMY()]], [[DTOC()]], [[DTOS()]], [[DTOV()]], [[Form Section Attributes]], [[Grid Column Attributes]], [[Grid Section Attributes]], [[LOCALE()]], [[MDY()]], [[SET CENTURY]], [[SET DATE]], [[SET EPOCH]], [[SET MARK]], [[STOD()]], [[VTOD()]]
  
 
==Description==
 
==Description==
The SET DATEFORMAT command specifies the input and output format for dates.  The following summarizes the available date formats.
+
The SET DATEFORMAT command can be used to configure the date format for datetextbox formitems and grid columns.   
 +
 
 +
The <expC> is the format string comprising the following:
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!width="60%"|Date||Format
+
!width="20%"|Format||Description
 
|-
 
|-
|AMERICAN (or MDY)||mm/dd/yy
+
|d||day as number without a leading zero (1 to 31)
 
|-
 
|-
|ANSI||yy.mm.dd
+
|dd||day as number with a leading zero (01 to 31)
 
|-
 
|-
|BRITISH or FRENCH or (DMY)||dd/mm/yy
+
|ddd||abbreviated localized day name (e.g. 'Mon' to 'Sun')
 
|-
 
|-
|FORMAT <cISOlocale>||Specified ISO locale code (from v6.0.2)
+
|dddd||long localized day name (e.g. 'Monday' to 'Sunday')
 
|-
 
|-
|GERMAN||dd.mm.yy
+
|M||month as number without a leading zero (1-12)
 
|-
 
|-
|ITALIAN||dd-mm-yy
+
|MM||month as number with a leading zero (01-12)
 
|-
 
|-
|JAPAN or (YMD)||yy/mm/dd
+
|MMM||abbreviated localized month name (e.g. 'Jan' to 'Dec')
 
|-
 
|-
|LOCALE||Current OS locale (from v6.0.2)
+
|MMMM||long localized month name (e.g. 'January' to 'December')
 
|-
 
|-
|USA||mm-dd-yy
+
|yy||year as two digit number (00-99)
 
|-
 
|-
|ISO||yyyy-mm-dd
+
|yyyy||year as four digit number
 
|-
 
|-
 
|}
 
|}
 
If SET CENTURY is ON, then the years will be formatted with four digits, i.e. yyyy.  The SET MARK command may be used to specify an alternate character to separate the parts of a date.
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
set date german
+
set dateformat on
use patrons index dates
+
set date to locale
seek ctod("01.01.98")
+
 
set century on
+
//or
seek ctod("01.01.1998")
+
 
set date format "en_GB"
+
set dateformat to "d.MM.yyyy"
set date locale
+
 
</code>
 
</code>
  

Revision as of 07:32, 18 May 2021

Purpose

Determine UI date formats for datetextbox formitems and grid columns

Syntax

SET DATEFORMAT ON | OFF | (<expL>)

SET DATEFORMAT TO <expC>

See Also

Advanced Canvas Control Attributes, Canvas Section Attributes, CTOD(), DATE(), DMY(), DTOC(), DTOS(), DTOV(), Form Section Attributes, Grid Column Attributes, Grid Section Attributes, LOCALE(), MDY(), SET CENTURY, SET DATE, SET EPOCH, SET MARK, STOD(), VTOD()

Description

The SET DATEFORMAT command can be used to configure the date format for datetextbox formitems and grid columns.

The <expC> is the format string comprising the following:

Format Description
d day as number without a leading zero (1 to 31)
dd day as number with a leading zero (01 to 31)
ddd abbreviated localized day name (e.g. 'Mon' to 'Sun')
dddd long localized day name (e.g. 'Monday' to 'Sunday')
M month as number without a leading zero (1-12)
MM month as number with a leading zero (01-12)
MMM abbreviated localized month name (e.g. 'Jan' to 'Dec')
MMMM long localized month name (e.g. 'January' to 'December')
yy year as two digit number (00-99)
yyyy year as four digit number

Example

set dateformat on
set date to locale
 
//or
 
set dateformat to "d.MM.yyyy"