About   |   Getting Started   |   Downloads   |   Documentation   |   Forum


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
current local time
04-29-2017, 11:30 AM
Post: #1
current local time
Time::Current() is set to UTC time, but it would be at least as useful to me to get the current local time (without leaving CORE).
Find all posts by this user
Quote this message in a reply
05-01-2017, 04:16 PM
Post: #2
RE: current local time
Add the result from Duration::TimeZoneOffset() to Time::Current() and you will achieve exactly what you're after.
Find all posts by this user
Quote this message in a reply
05-02-2017, 05:47 AM (This post was last modified: 05-02-2017 04:33 PM by Rick Johnson.)
Post: #3
RE: current local time
Thanks, Garrett! One of my standard classes uses Time and Duration so I'll make a method there that utilizes this. I won't miss <ctime>!

It dawned on me to double-check the Date class. The notes say:

\brief Constructs a Date object from the current system date
...
\returns A Date object for the current UTC time


I made the mistake of reading the first line and taking "current system date" at its word. In most instances, this shouldn't make a difference, but if the actual date matters more than a duration of days, I'll use the timeZoneOffset() there, too.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)