常用类记录

日期时间类

public class DateTimeHelper

{

	public string ConvertToTimeStamp(DateTime dt)

	{

		DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1, 0, 0, 0, 0));

		long t = (dt.Ticks - dtStart.Ticks) / 1000;



		return t.ToString();

	}

}

 

public static string OutputArray(string[] array, string seperator = ">")

        {

            string strTemp = "";

            if (array == null || array.Length == 0)

                return "";

            for (int i = 0; i <= array.Length; i++)

            {

                if (i == array.Length - 1)

                {

                    strTemp += array[i];

                    break;

                }

                strTemp += array[i] + seperator;

            }

            return strTemp;

        }

  

你可能感兴趣的:(常用)