question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider Using DateTimeOffset Instead of DateTime

See original GitHub issue

I’ve been going over my code and have been moving over my “ticks” or “candles” to Trady.Core.Candle. However, I just noticed that the “tick” is a DateTime rather than a DateTimeOffset. From my understanding, DateTimeOffsets are preferred as they contain timezones and save a lot of additional work (in theory?).

Anyways, I was wondering what the feeling is on updating the ITick.DateTime field to be a DateTimeOffset instead.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
karlwanclcommented, Nov 14, 2017

@Mike-EEE I have just released a beta-version on this issue, just let you know 😄

1reaction
karlwanclcommented, Oct 26, 2017

@Mike-EEE Sorry for the late response. You’ve made a good argument on using DateTimeOffset rather than using DateTime.

To be honest, I didn’t think of it when I initially created this library, I was focusing on implementing indicators & the rule system. This library is now heavily rely on DateTime, but I agree that it should be a change to work around with the timezone problem. The only problem is there may be a large code change from it 🤣

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateTime vs DateTimeOffset
DateTimeOffset expands on this by being able to store local times from anywhere in the world. It also stores the offset between that...
Read more >
Converting between DateTime and DateTimeOffset
DateTimeOffset reflects a time's offset from UTC, but it doesn't reflect the actual time zone to which that offset belongs. For more information ......
Read more >
DateTimeOffset vs DateTime - What's the difference?
The DateTimeOffset structure represents a date and time value, together with an offset that indicates how much that value differs from UTC. Thus ......
Read more >
C# - DateTimeOffset versus DateTime, why use offsets?
DateTime and DatimeTimeOffset are very much alike. They both consist of a date and a time, however a DateTimeOffset also has an offset,...
Read more >
DateTimeOffset vs DateTime - Which One To Use? (C# .NET)
In this video, I will show you the difference between DateTime and DateTimeOffset (C# .NET) and what you should consider when using them....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found