<div dir="auto">Please read the QDateTime docs accurately.<div dir="auto"><br><br><div data-smartmail="gmail_signature" dir="auto">Konstantin</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 9 апр. 2019 г., 15:11 Pouya Shahinfar <<a href="mailto:pswinpo@gmail.com">pswinpo@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Although QDateTime has a full set of methods for working with date and times in Qt, It could lead to misunderstanding. How? Well when you are saving a date or time in this class you do not know the time is local time, UTC time or it is for a specific timezone. Therefore, maintaining the application becomes harder. Let's consider this scenario:</div><div><br></div><div>You open a project which is developed by someone else, and he/she used QDateTime for holding time and date. The problem here is you as a newcomer to project do not know the value in the class is based on UTC or local time, etc. if there was a class like QLocalDateTime, the code was more maintainable. </div><div><br></div><div>Qt has an awesome set of classes but unfortunately when it comes to timing. the classes are really awkward. For instance, there is not a class for holding a time-span:</div><div><br></div><div><a href="https://forum.qt.io/topic/3160/qtimespan-interest" target="_blank" rel="noreferrer">https://forum.qt.io/topic/3160/qtimespan-interest</a></div><div><br></div><div>As far as I concern, It would be a good idea that Qt has the following class:</div><div>1. QTimeSpan -> for holding duration of time.</div><div>2. QInstant -> For holding an instant of time in UTC time (like Java)<br></div><div>3. QLocalDateTime -> For holding local datetime</div><div>4. QUTCDateTime -> For holding UTC datetime</div><div>5. QZonedDateTime -> For date and times which is in a specific timezone.</div><div><br></div></div></div></div>
_______________________________________________<br>
Development mailing list<br>
<a href="mailto:Development@qt-project.org" target="_blank" rel="noreferrer">Development@qt-project.org</a><br>
<a href="https://lists.qt-project.org/listinfo/development" rel="noreferrer noreferrer" target="_blank">https://lists.qt-project.org/listinfo/development</a><br>
</blockquote></div>