-
Notifications
You must be signed in to change notification settings - Fork 37
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
DateTimeorDatetime?property. Thus, these do not need any conversion and can be used directly. - some endpoints express separate
dateandminuteproperties. These are marked withITimestampedDateMinute. It is recommended that you use theGetTimestampInUTC()andGetTimestampInEST()extension methods to get the proper DateTime. Those methods take into account 'date' and 'minute' and timezone. - some endpoints express just a
minuteproperty alone. These are marked withITimestampedMinute. You may use theGetTimeOfDayInEST()extension method to parse this property. - some endpoints express a single property of type
long, with varying names. You may use theConvertFromUnixMilliSecToDateTime()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 typelong. 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