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;
            }

  • 相关阅读:
    linux命令-ps
    solr参数说明
    CAP原理和BASE思想
    java多线程文件上传服务器
    swift的简介
    浅谈对【OSI七层协议】的理解
    手写简易WEB服务器
    JVM知识整理和学习(转载并修改)
    多线程学习笔记六
    多线程学习笔记五
  • 原文地址:https://www.cnblogs.com/secying/p/2172300.html
Copyright © 2011-2022 走看看