0

Get Result from json file. How To convert this object type "1515628800000" into C# Date Time format. i tried to this method but it give me exception.

DateTime.ParseExact(item.StartDate, @"dd/MM/yyyy", CultureInfo.InvariantCulture);
Vijunav Vastivch
  • 4,153
  • 1
  • 16
  • 30
  • well yes - you told it to find dd/MM/yyyy and then gave it just a long string of numbers! – BugFinder Jan 11 '18 at 08:22
  • 1
    Is `1515628800000` in milliseconds instead of concrete `DateTime`? You need to use date format string if you want using `DateTime.ParseExact`. Read [this](https://stackoverflow.com/questions/23381870/conversion-from-milliseconds-to-datetime-format) if you want to convert milliseconds to `DateTime`. – Tetsuya Yamamoto Jan 11 '18 at 08:23
  • `1515628800000` Where is the Year, Month,Day and time? If you determine one those then you can create a complete datetime using substring. – Vijunav Vastivch Jan 11 '18 at 08:25

0 Answers0