zoukankan      html  css  js  c++  java
  • 日本财政年度取得(c#,vb.net)

    vb.net:

      '----------------------------------------------------------------
        '-  @(f)
        '-
        '-  機    能: 日本財政年度取得
        '-
        '-  返    値:    日本財政年度
        '-
        '-  引    数: 日付
        '-
        '-  機能説明: 日本財政年度取得
        '-
        '----------------------------------------------------------------
        Public Function GetJpNendo(ByVal dtValue As Date) As String
            Dim strNendo As String

            Try
                strNendo = dtValue.ToString().Substring(0, 4)
                Dim dtTemp As Date = CDate(strNendo & "/03/31")
                If Date.Compare(dtValue, dtTemp) < 0 OrElse Date.Compare(dtValue, dtTemp) = 0 Then
                    strNendo = CStr(CInt(strNendo) - 1)
                End If
            Catch ex As Exception
            End Try
            Return strNendo
        End Function

    c#:

        /// <summary>
            /// 日本財政年度取得
            /// </summary>
            /// <param name="dtValue">日付</param>
            /// <returns>日本財政年度</returns>
            private string GetJPNendo(DateTime dtValue)
            {
                string strNendo = string.Empty;
                try
                {
                    strNendo = dtValue.ToString().Substring(0, 4);
                    DateTime dtTemp = DateTime.Parse(strNendo + "/03/31");
                    if (dtValue <= dtTemp)
                    {
                        strNendo = Convert.ToString(Convert.ToInt32(strNendo) - 1);
                    }
                }
                catch
                {
                }
                return strNendo;
            }

  • 相关阅读:
    tomcat对sessionId的处理分析
    MySQL 5.5 新增SIGNAL异常处理
    jetty对sessionId的处理分析
    Python3.x和Python2.x的区别
    java actor模型和消息传递简单示例
    构建工具scons让一切变得简单
    HTML元素控件事件表
    开始新的旅途
    JS各种常见知识点
    C#代码与javaScript函数的相互调用
  • 原文地址:https://www.cnblogs.com/secying/p/2172300.html
Copyright © 2011-2022 走看看