☝️Small business or a startup? See if you qualify for our special offer.
+

datetime taken as string in imported file

Re-Open
Varun asked 2 days ago

Hi,

It seems that date field is being imported with time when we try to upload a csv . In our csv , it is set as d/MM/yyyy hh:mm:ss format. We would like to import this field as dd/MM/yyyy in date format into the pivot grid.

How can we achieve this result.

 

Thanks,

Varun

2 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 22 hours ago

Hello Varun,

Thank you for reaching out to us.

Please note that Flexmonster does not support the d/MM/yyyy hh:mm:ss input date format. The date should be in the yyyy-MM-dd'T'HH:mm:ss format.

If you are using Flexmonster Data Server, it only supports the ISO 8601 date format. For example:

    • "2021-04-25" - Date.
    • "2021-04-25T21:30:05" - Date and time.
    • "2021-04-25T21:30:05+03:00" - Date and time with a time zone.

When you load the data with the correct date format, you can set the type property of the Mapping object as "date string". Its default pattern string is "dd/MM/yyyy". Also, it can be configured using the datePattern property of the OptionsObject. You are welcome to check our documentation for more details: https://www.flexmonster.com/doc/date-and-time-formatting/#format-date-string.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Varun 19 hours ago

Hi Nadia,

 

Thanks for sharing the example. I tried to export xlsx using same method as explained on Using datePattern to change the default date format - JSFiddle - Code Playground

but it exported date field as string .

Could you please try to export xlsx by running script on Using datePattern to change the default date format - JSFiddle - Code Playground

, apply filter on date field in the excel sheet and see if you get it as date or string.

What we want, when we apply filter on date field in the excel, we should have year followed by month and day. I attached a screenshot for reference.

 

Thanks,

Varun

 

 

Please login or Register to Submit Answer