Page 1 of 1

Convert Date to Internal Format

Posted: Mon Aug 10, 2009 3:31 pm
by rcil
Is there a way to convert the input date into internal format without knowing the format it is in?

Input Date can be in below formats:
14977 ----internal format
2009-01-01
2009/01/01
01/01/2009

Irrespective of the input format my output should be 14977 (in the internal format)

Is this possible with OConv(IConv,xxxxx),xxxxxx) ?

Any help is much appreciated.

Posted: Mon Aug 10, 2009 3:37 pm
by chulett
See if this article helps. You need to get the component order correct and it can do the rest.

ps. Just use IConv - for internal format no OConv is needed since it does 'output' or 'external' format conversions.

Posted: Mon Aug 10, 2009 5:10 pm
by ray.wurlod
Yes it's possible but you'll need to:
  • (a) use an If..Then..Else to determine whether the year is first or last (use Matches operator)

    (b) use a business rule to resolve ambiguity about whether 01/02 is January 2nd or 1st February (for example)