using System;
namespace Core.Util
{
public static partial class Extention
{
public static string ToAscllStr(this int ascllCode)
{
if (ascllCode >= 0 && ascllCode <= 255)
{
System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
byte[] byteArray = new byte[] { (byte)ascllCode };
string strCharacter = asciiEncoding.GetString(byteArray);
return (strCharacter);
}
else
{
throw new Exception("ASCII Code is not valid.");
}
}
public static DateTime ToDateTime_From_JsGetTime(this long jsGetTime)
{
DateTime dtStart = new DateTime(1970, 1, 1).ToLocalTime();
long lTime = long.Parse(jsGetTime + "0000");
TimeSpan toNow = new TimeSpan(lTime);
DateTime dtResult = dtStart.Add(toNow);
return dtResult;
}
}
}