Yy date transformations

I find it odd that two digit years are translated to 19nn, especially since we’re over 20 years into the 21st century or, conversely we could be dealing with older historical data. Documentation states: “If the date to be converted has only two year digits, it is treated as a date between 1900 and 1999. E.g. “31/1/19” is interpreted in d-M-yy format as 31st January 1919.”

It’d be nice if the century was customizable.

I agree that it isn’t very intuitive. However we use a third party library for this feature, so it isn’t something we can change, unless we rewrite it from scratch ourselves.

Note also that you can do date and datetime conversions in Javascript:
https://www.easydatatransform.com/help/1n/windows/html/javascript.html

However Javascript has its own idiosyncrasies around dates, e.g. first day of month=1, first month of year=0 !

I think in the case of adding the correct century I wonder if this isn’t more a string manipulation issue rather than a date issue. Or perhaps a math issue.

For example, lets say I have a bunch of dates like MM/DD/YY. So 01/15/18 for Jan 15 2018. If I try to convert to yyyy I would get 01/15/1918, which is less and less acceptable.

Seems to me the workaround is to convert the date with Date Format to YY/MM/DD. So I have something like 18/01/15.
Next use Insert to shove “20” at the start of the column, giving us 2018/01/15.
Once we have that we can further use Date Format to do whatever we need.

It’s not exactly super efficient but probably not a terrible workaround.

Re the javascript suggestion. Just a general thought on the javascript feature. I think the feature is stellar and it’s a really valuable thing to make available. But on the other hand, basically you’re asking people to write code which doesn’t quite match up with the premise of the app, EASYdatatransform
(That said, please don’t remove the feature :grinning:)

Note that you can change a 2 digit year to a 4 digit year with Replace:

For example the above changes:

01/15/18

To:

01/15/2018

We hope customers can do the vast majority of their work with the standard transforms. The Javascript transform is a fall back for that other 5%.

Replace is a much more flexible solution, thank you.

1 Like

You can also do this:

image

Yes, thanks. That’s the first thing I tried but it didn’t work. But obviously I did it incorrectly because it works just fine now!