IvyTools

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Author Topic: Date/time format  (Read 5868 times)

Antony

  • Guest
Date/time format
« on: April 12, 2018, 09:24:18 AM »

Dear Ivy team,
Is there a way to specify date/time format for "toDate()" function? It doesn't seem to work for dates in did/mm/yyyy format, only mm/dd/yyyy.

Thanks,
Antony G.
Logged

admin

  • Administrator
  • Full Member
  • *****
  • Posts: 33
    • View Profile
Re: Date/time format
« Reply #1 on: April 13, 2018, 03:25:21 PM »

Hi Antony,

It can be done in the latest release:

Code: [Select]
IvyOptions.ToDateFormatMonthFirst = true;
If you are using IvyTemplateEditor it can be set on the template level (Template Settings / Template Custom Code):

Code: [Select]
protected override void Init()
{
    IvyOptions.TableCellType = TableCellType.String;
    IvyOptions.ToNumberCultureInfo = new CultureInfo("fr-FR");
    IvyOptions.ToDateFormatMonthFirst = true;
}

Regards,
Ivy Team
Logged