locked
Active Directory Long Date Conversion RRS feed

  • Question

  • Hi this must have been asked a dozen times,

    but i have been battling for hours and search as well, trying to find a way to do the correct conversion to string for a DateTime Values for AD,

    this is what i got but its not the right time 01/01/01 12:00:00AM is what the below code is giving

    txtWhenChanged.Text = Convert.ToString(Convert.ToDateTime(adObjects.GetDirectoryEntry().Properties["whenChanged"].Value));

    please help me!

    Friday, July 29, 2016 9:45 PM

Answers

  • found my problem

    was the machine needed administrative rights to give me all the values i needed no needed to convert them either

    • Marked as answer by Killer47x Tuesday, August 2, 2016 8:08 AM
    Tuesday, August 2, 2016 8:08 AM

All replies

  • Looks like Date.Min value, are you sure there is a valid date?

    Console.WriteLine(System.DateTime.MinValue);
    1/1/0001 12:00:00 AM



    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, July 29, 2016 10:19 PM
  • found my problem

    was the machine needed administrative rights to give me all the values i needed no needed to convert them either

    • Marked as answer by Killer47x Tuesday, August 2, 2016 8:08 AM
    Tuesday, August 2, 2016 8:08 AM