Skip to content

DateTime

Victor Lee edited this page May 10, 2020 · 3 revisions

IEX uses several different ways to express DateTime

  • some endpoints express a just a date. These are implemented with either a DateTime or Datetime? property. Thus, these do not need any conversion and can be used directly.
  • some endpoints express separate date and minute properties. These are marked with ITimestampedDateMinute. It is recommended that you use the GetTimestampInUTC() and GetTimestampInEST() extension methods to get the proper DateTime. Those methods take into account 'date' and 'minute' and timezone.
  • some endpoints express just a minute property alone. These are marked with ITimestampedMinute. You may use the GetTimeOfDayInEST() extension method to parse this property.
  • some endpoints express a single property of type long, with varying names. You may use the ConvertFromUnixMilliSecToDateTime() extension method to parse this property. Because there are so many different names, I could not create an interface to apply to them all, so this extension method is less clean, as it applies to all variables of type long. If anyone has any ideas on how to make this cleaner, please open an issue or send a PR.

The extension methods are all located in IEXSharp.Helper.DateTimeExtensions

Clone this wiki locally