Date Conversation

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/9/2010 2:11:01 AM
Gravatar
Total Posts 104

Date Conversation

Hello
I want to develop a simple module for Date Conversation. I can convert Christian date to Persian and show the result, but when I try to convert Persian date to Christian, because mojoportal shows date time as current culture calendar, the result that shows is incorrect for who their language set to Persian. ( again Persian date shows.)
How can I display correct date?

Thanks
 

1/9/2010 10:20:43 AM
Gravatar
Total Posts 18439

Re: Date Conversation

In your custom feature you can change the culture used by the executing thread to whatever culture you want. Or else create a CultureInfo object and use it for formatting the date strings rather than letting it use the one the thread is running on.

CultureInfo myCulture = new CultureInfo("en-US");

string formatedDate = DateTime.UtcNow.ToString(myCulture);
 

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.