by
0
6
929
0
Top 5% !
Popular
Tagged
Easy-to-find
Specified
OpenSource
Popularity: 27194th place
Created
Modified Jan 9, 2015

Published on:

LanguageCSharp
LicenseMIT_X11
OSWindows

ConvertToDisplayDateTime

//protected void setPassword_Click(object sender, EventArgs e)
//{
//    if (IsValid)
//    {
//        var result = OpenAuth.AddLocalPassword(User.Identity.Name, password.Text);
//        if (result.IsSuccessful)
//        {
//            Response.Redirect("~/Account/Manage.aspx?m=SetPwdSuccess");
//        }
//        else
//        {
//            ModelState.AddModelError("NewPassword", result.ErrorMessage);
//        }
//    }
//}
//public IEnumerable<OpenAuthAccountData> GetExternalLogins()
//{
//    var accounts = OpenAuth.GetAccountsForUser(User.Identity.Name);
//    CanRemoveExternalLogins = CanRemoveExternalLogins || accounts.Count() > 1;
//    return accounts;
//}
//public void RemoveExternalLogin(string providerName, string providerUserId)
//{
//    var m = OpenAuth.DeleteAccount(User.Identity.Name, providerName, providerUserId)
//        ? "?m=RemoveLoginSuccess"
//        : String.Empty;
//    Response.Redirect("~/Account/Manage.aspx" + m);
//}
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/279518/ConvertToDisplayDateTime?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//protected void setPassword_Click(object sender, EventArgs e) //{ // if (IsValid) // { // var result = OpenAuth.AddLocalPassword(User.Identity.Name, password.Text); // if (result.IsSuccessful) // { // Response.Redirect("~/Account/Manage.aspx?m=SetPwdSuccess"); // } // else // { // ModelState.AddModelError("NewPassword", result.ErrorMessage); // } // } //} //public IEnumerable<OpenAuthAccountData> GetExternalLogins() //{ // var accounts = OpenAuth.GetAccountsForUser(User.Identity.Name); // CanRemoveExternalLogins = CanRemoveExternalLogins || accounts.Count() > 1; // return accounts; //} //public void RemoveExternalLogin(string providerName, string providerUserId) //{ // var m = OpenAuth.DeleteAccount(User.Identity.Name, providerName, providerUserId) // ? "?m=RemoveLoginSuccess" // : String.Empty; // Response.Redirect("~/Account/Manage.aspx" + m); //} protected static string ConvertToDisplayDateTime(DateTime? utcDateTime) { // You can change this method to convert the UTC date time into the desired display // offset and format. Here we're converting it to the server timezone and formatting // as a short date and a long time string, using the current thread culture. return utcDateTime.HasValue ? utcDateTime.Value.ToLocalTime().ToString("G") : "[never]"; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus