Tuesday, June 18, 2013

languageBasedDateFormat

static void languageBasedDateFormat(Args _args)
{
    int     sequence;
    int     dayformat;
    int     separator1;
    int     monthformat;
    int     separator2;
    int     yearFormat;
    LanguageId  lanId;

    lanId = CompanyInfo::languageId();
    
    switch (lanId)
    {
        case "en-us":
            sequence = 123;
            dayformat =  DateDay::Digits2;
            separator1 = DateSeparator::Slash;
            monthformat = DateMonth::Digits2;
            separator2 = DateSeparator::Slash;
            yearFormat = DateYear::Digits4;
        break;

        case  "en-gb":
            sequence = 321;
            dayformat =  DateDay::Digits2;
            separator1 = DateSeparator::Slash;
            monthformat = DateMonth::Digits2;
            separator2 = DateSeparator::Slash;
            yearFormat = DateYear::Digits4;
        break;
    }


    print systemDateGet();
    print date2Str(systemDateGet(), sequence, dayformat, separator1,monthformat, separator2, yearFormat);
    pause;


}