Date parsing formats
Date display formats
Formats reference

 

Date parsing formats

Date parsing defines how LabKey interprets user-entered dates, to store the date value.
It allows to define two parsing formats:

  • US parsing (MDY): Month + Day + Year
  • Non-Us parsing (DMY): Day + Month + Year       <---- this is the currently active format in this site

Example:

There are dates which could be ambiguous.
If user enters "10-4-80" or "10/4/80", it will be interpreted in different forms depending on the parsing format set:

Parsing Format  Date stored
US parsing4th October 1980 
Non-Us parsing10th April 1980


Date parsing format can only be set globally, at site level by a site admin, and affects all the projects.

Note:
LabKey date parser does not recognize time-only entered strings.
This means that you need to enter a full date string even when you wish to display time only.
For example, you might enter a value of "2/2/09 4:00 PM" in order to display "04 PM" when using the format string "hh aa".

 

Date display formats

Date display defines how LabKey shows dates in views, independently of the format used to enter the date.

Example:

If user enters "25-5-15 13:05", it will be shown in different ways depending on the display format set:

Display Format StringDate displayed
dd-MMM-yyyy HH:mm25-May-2015 13:05
dd-MM-yyyy HH:mm25-05-2015 13:05
d-M-yyyy H:m25-5-2015 13:5
dd-MMM-yyyy hh:mm a25-May-2015 01:05 PM


Date display format can be set at several levels:

  • globally, applying to the whole site
  • at the project level, in menu "Admin ---> Folder --> Project Settings --> Default display format for dates"
  • on a per-field basis: view the list (or dataset), "View Design --> Edit Design" (or "Manage Dataset --> Edit Definition"), select the field to format, add the format string in the "Format" tab.


 Attention!!
 Display formats have no effect when editing dates. In edit form, the dates are always shown with format yyyy-MM-dd HH:mm, but need to be entered in parsing format.
 

 

Formats reference

See the LabKey documentation page Date and Number Formats Reference.

Discussion