<i id='HITAq'><tr id='HITAq'><dt id='HITAq'><q id='HITAq'><span id='HITAq'><b id='HITAq'><form id='HITAq'><ins id='HITAq'></ins><ul id='HITAq'></ul><sub id='HITAq'></sub></form><legend id='HITAq'></legend><bdo id='HITAq'><pre id='HITAq'><center id='HITAq'></center></pre></bdo></b><th id='HITAq'></th></span></q></dt></tr></i><div id='HITAq'><tfoot id='HITAq'></tfoot><dl id='HITAq'><fieldset id='HITAq'></fieldset></dl></div>

<small id='HITAq'></small><noframes id='HITAq'>

      • <bdo id='HITAq'></bdo><ul id='HITAq'></ul>

      <legend id='HITAq'><style id='HITAq'><dir id='HITAq'><q id='HITAq'></q></dir></style></legend>

      1. <tfoot id='HITAq'></tfoot>
      2. 在 C# 中将 LDAP AccountExpires 转换为 DateTime

        Convert LDAP AccountExpires to DateTime in C#(在 C# 中将 LDAP AccountExpires 转换为 DateTime)

          <small id='9fOeS'></small><noframes id='9fOeS'>

          <i id='9fOeS'><tr id='9fOeS'><dt id='9fOeS'><q id='9fOeS'><span id='9fOeS'><b id='9fOeS'><form id='9fOeS'><ins id='9fOeS'></ins><ul id='9fOeS'></ul><sub id='9fOeS'></sub></form><legend id='9fOeS'></legend><bdo id='9fOeS'><pre id='9fOeS'><center id='9fOeS'></center></pre></bdo></b><th id='9fOeS'></th></span></q></dt></tr></i><div id='9fOeS'><tfoot id='9fOeS'></tfoot><dl id='9fOeS'><fieldset id='9fOeS'></fieldset></dl></div>

            1. <tfoot id='9fOeS'></tfoot>
              <legend id='9fOeS'><style id='9fOeS'><dir id='9fOeS'><q id='9fOeS'></q></dir></style></legend>

                <bdo id='9fOeS'></bdo><ul id='9fOeS'></ul>
                  <tbody id='9fOeS'></tbody>
                  本文介绍了在 C# 中将 LDAP AccountExpires 转换为 DateTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将 18 位字符串从 LDAP AccountExpires 转换为普通日期时间格式.

                  I want to convert 18 digit string from LDAP AccountExpires to Normal Date Time Format.

                  129508380000000000 >> 2011 年 5 月 26 日

                  129508380000000000 >> May 26 2011

                  我通过以下链接获得了上述转换.

                  I got the above conversion from using the following link.

                  http://www.chrisnowell.com/information_security_tools/date_converter/Windows_active_directory_date_converter.asp?pwdLastSet,%20accountExpires,%20lastLogonTimestamp,%20lastLogon,%20and%20badPasswordTime

                  我尝试使用 DateTime.Parse 或 Convert.ToDateTime 进行转换.但没有成功.

                  I tried to convert by using DateTime.Parse or Convert.ToDateTime. But no success.

                  有人知道如何转换吗?非常感谢.

                  Anyone know how to convert it? Thanks very much.

                  推荐答案

                  编辑答案

                  根据 参考,它是自 1601 年 1 月 1 日 UTC 以来的刻度数,它描述了 1601 年的意义.良好的背景阅读.

                  Edited answer

                  It's the number of ticks since Jan-01-1601 in UTC, according to Reference, which describes the significance of the year 1601. Good background reading.

                  var accountExpires = 129508380000000000;
                  var dt = new DateTime(1601, 01, 01, 0, 0, 0, DateTimeKind.Utc).AddTicks(accountExpires);
                  

                  接受的原始答案

                  这是自 1601 年 1 月 2 日以来的滴答数.

                  Original Accepted Answer

                  It's the number of ticks since Jan-02-1601.

                  DateTime dt = new DateTime(1601, 01, 02).AddTicks(129508380000000000);
                  

                  这篇关于在 C# 中将 LDAP AccountExpires 转换为 DateTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)

                1. <legend id='goeK3'><style id='goeK3'><dir id='goeK3'><q id='goeK3'></q></dir></style></legend>

                  • <bdo id='goeK3'></bdo><ul id='goeK3'></ul>
                    <i id='goeK3'><tr id='goeK3'><dt id='goeK3'><q id='goeK3'><span id='goeK3'><b id='goeK3'><form id='goeK3'><ins id='goeK3'></ins><ul id='goeK3'></ul><sub id='goeK3'></sub></form><legend id='goeK3'></legend><bdo id='goeK3'><pre id='goeK3'><center id='goeK3'></center></pre></bdo></b><th id='goeK3'></th></span></q></dt></tr></i><div id='goeK3'><tfoot id='goeK3'></tfoot><dl id='goeK3'><fieldset id='goeK3'></fieldset></dl></div>

                      <small id='goeK3'></small><noframes id='goeK3'>

                      <tfoot id='goeK3'></tfoot>
                        <tbody id='goeK3'></tbody>