Zoho Deluge: Date from a String (dd/MM/yyyy to yyyy-MM-dd)
- Joel Lipman
- Zoho
- Hits: 9395
A quick article to remind me of the regex to change a date from the format dd/MM/yyyy to yyyy-MM-dd.
Why?
Irrespective of server, organization or user settings, the date handling can vary. If we are getting a date from a CSV or other external source as "dd/MM/yyyy", how do we guarantee that the system will understand the date correctly?
How?
It may be that when obtaining a date string and applying the method .toString("dd/MM/yyyy") is dependent on the settings. But making a date into a SQL format or from largest denominator to smallest in "yyyy-MM-dd" will usually handle the date better.