class/HDTY.PublicLib.cs

(开头部分) 34KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HDTY.PublicLib
{
    #region 日期时间类

    /// <summary>
    /// 日期时间相关的函数集
    /// </summary>
    public class T_HDDateTime
    {

        System.DateTime currentTime;

        /// <summary>
        /// 构造函数
        /// </summary>
        public T_HDDateTime()
        {
            currentTime = System.DateTime.Now;
        }

        /// <summary>
        /// 获取当前的日期时间
        /// 格式自己组合:其中yyyy表示年;MM:表示月;dd:表示日期;hh:表示小时;mm:表示分钟;ss:表示秒信息;fff:表示毫秒信息
        /// </summary>
        /// <param name="Formatstring"></param>
        /// <returns></returns>
        public string Func_GetNowDateTime(string Formatstring)
        {
            string result = "";
            try
            {
                result = currentTime.ToString(Formatstring);

            }
            catch (Exception ex)
            {
                throw new Exception("获取当前的日期时间失败" + ex.ToString());
            }
            return result;
        }


        /// <summary>
        /// 静态方法:获取当前的日期时间
        /// 格式自己组合:其中yyyy表示年;MM:表示月;dd:表示日期;hh:表示小时;mm:表示分钟;ss:表示秒信息;fff:表示毫秒信息
        /// </summary>
        /// <param name="HasMilliSecond">是否包含毫秒</param>
        /// <returns></returns>
        public static string Func_GetCurrentDateTime(string Formatstring)
        {
            string result = "";
            try
            {
                System.DateTime currentTime = System.DateTime.Now;
                result = currentTime.ToString(Formatstring);
后面还有 967 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。