Skip to Content
0
Former Member
Sep 07, 2007 at 06:38 PM

Change of DATE format in EXCEL sheet

144 Views

Hi All,

I need to have the <b>dates in an excel sheet</b> in <b>MM/dd/yyyy format</b>. Let me give you a situation.

Suppose I have 2 users, say <b>user1</b> and <b>user2</b>. For <b>user1</b>, I need to give the date in <b>yyyy/MM/dd</b> format and for <b>user2</b> in <b>MM/dd/yyyy</b> format.

I have defined a <b>function in component controller</b> for generating the <b>excel f</b>ile. In that function also I have used<b> ISimpleModifiableType</b> to set the format of date as per the user. I am displaying the dates in the <b>View</b> and also setting them in the<b> Excel sheet</b>.

I am <b>calling this function from the V</b>iew where I need to <b>display the date</b> as well as <b>provide the Excel generating LinkToURL</b>.

When I call this function, <b>it is displaying the dates in the required format</b> for both the users correctly, <b>ie yyyy/MM/dd for user1 and MM/dd/yyyy for user2</b>. <b>But, in the excel sheet, the format is not coming as per the requirement</b>. For user1, the dates are coming correctly in yyyy/MM/dd format. But for user2 also, the format is coming in yyyy/MM/dd <b> instead of MM/dd/yyyy</b>. I have <b>used the same attribute</b> to display the date in the screen , which is giving date in proper format as per user.

Please suggest <b>how to put the date in MM/dd/yyyy format in the excel sheet</b>.

Thanks,

Reinuka