Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivbm88
Creator
Creator

Formula for date format identification

Hi All,

Is there a formula that can get a date and return it's format?

Example:

Input: 31122015 Output: DDMMYYYY

1 Solution

Accepted Solutions
sunny_talwar

Here is what I suggest

If(Num(Date#(DateField, 'DDMMYYYY')) > 0, 'DDMMYYYY',

     If(Num(Date#(DateField, 'YYYYMM')) > 0, 'YYYYMM',

          If(Num(Date#(DateField, 'YYYYMMDD')) > 0, 'YYYYMMDD',

               ..... and so on...

View solution in original post

6 Replies
sunny_talwar

You might be able to create one... but the issue will be for an input like this 01022015... is this DDMMYYYY or MMDDYYYY?

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Yaniv,

Please Use Below Code:

=Date(Date#('31122015','DDMMYYYY'),'DD-MM-YYYY')

Thanks,

Arvind Patil

arvind_patil
Partner - Specialist III
Partner - Specialist III

=Date(Date#('31122015','DDMMYYYY'),'Write Your Date Format Here')


Thanks,

Arvind Patil

sunny_talwar

Arvind OP is looking to get the format as an output

When the user enters 31122015, they need to see DDMMYYYY

yanivbm88
Creator
Creator
Author

Anything you know that already exists?

Regarding the issue you raised, I guess that is something that will have to be defined as a fixed property. When Day and month can be both, choose X. (Maybe according to country standard format)

sunny_talwar

Here is what I suggest

If(Num(Date#(DateField, 'DDMMYYYY')) > 0, 'DDMMYYYY',

     If(Num(Date#(DateField, 'YYYYMM')) > 0, 'YYYYMM',

          If(Num(Date#(DateField, 'YYYYMMDD')) > 0, 'YYYYMMDD',

               ..... and so on...