Date & Time Formats

  • 2 months ago
  • 27 views
  • 0 comments

  • About 1 minute to read

Most of the dates presented within Plato are displayed in a friendly format. For example "just now", "1 hour ago", "yesterday", "last week", "2 weeks ago" etc. Whenever a human friendly date is displayed you can usually hover over the date or tap the date to see the full date & time.

The full date & time displayed when you hover over or tap a friendly date can be customised via the Date Format drop down list available on the General Settings page.

Localising Friendly Dates

To localise the friendly dates ("just now", "1 hour ago", "yesterday" etc) you will need to edit the strings contains within the Plato.Core strings.json file.

Regional Formatting

Dates within Plato will be displayed based on the region set for your servers underlying operating system. If your web servers region is set to "United States" then dates will be presented as MM/DD/YYYY within the Plato user interface. If your web servers region is set to "United Kingdom" then dates would be presented as DD/MM/YYYY within the Plato user interface.

If needed you can override the servers region via request localisation provided by .NET Core. You can see below we've added a UseRequestLocalization extension method into the Plato start-up process to register additional middle ware & services and set-up some options to control our default user interface culture...

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    app.UseStaticFiles();

    IList<CultureInfo> supportedCultures = new List<CultureInfo>
    {
        new CultureInfo("en-US"),
        new CultureInfo("fi-FI"),
    };
    app.UseRequestLocalization(new RequestLocalizationOptions
    {
        DefaultRequestCulture = new RequestCulture("en-US"),
        SupportedCultures = supportedCultures,
        SupportedUICultures = supportedCultures
    });
}
Can we improve this doc? Login or register to tell us how
Your Feedback
Cancel
In this doc