Format:
Recent snippets for: pandiyachendur
public DateTime getIndianStandardTime() { TimeZoneInfo IND_ZONE=TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); return TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, IND_ZONE); }
240 Views
no comments
public string GetMonthNumberFromAbbreviation(string mmm) { string[] monthAbbrev = CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedMonthNames; int index = Array.IndexOf(monthAbbrev, mmm) + 1; return index.ToString("0#"); }
209 Views
no comments
public string GetRandomPasswordUsingGUID(int length) { string guidResult = System.Guid.NewGuid().ToString(); guidResult = guidResult.Replace("-", string.Empty); if (length <= 0 || length > guidResult.Length) throw new ArgumentException("Length must be between 1 and " + guidResult.Length); return guidResult.Substring(0, length); }
264 Views
no comments
public string GetJSONString(DataTable Dt) { string[] StrDc = new string[Dt.Columns.Count]; string HeadStr = string.Empty; for (int i = 0; i <> { StrDc[i] = Dt.Columns[i].Caption; HeadStr += "\"" + StrDc[i] + "\" : \"" + StrDc[i] + i.ToString() + "¾" + "\",";
318 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
