+ Reply to Thread
Results 1 to 2 of 2

Thread: Find the Maximum date in an Array

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    15

    Find the Maximum date in an Array

    So i have that array of dates and i want to get the maximum date without using LINQ :
    Code:
    DateTime[] dt = new DateTime[10];

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    28
    Here's a solution which uses sorting so that it becomes sorted before starting:
    Code:
    Array.Sort(dt);
    DateTime maxValue = dt[dt.Length - 1];

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts