Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Qt C++ Convert seconds to formatted string (hh:mm:ss)

Your timezone is included in it thats why. Try this:

QDateTime::fromTime_t(10).toUTC().toString("hh:mm:ss");

There is no QTime::fromTime_t; possibly you're using QDateTime::fromTime_t, which accounts for time zones and daylight savings.

Instead you can use QTime().addSecs(10).toString(...).

Tags:

C++

Qt

Related

What is the use of encapsulation when I'm able to change the property values with setter methods? Sparkle effect iOS Java Method Call Expected How to enforce Functional Programming on Scala Normalizing dictionary values Git cherry pick equivalent in Perforce? Matplotlib fill between multiple lines Invalid initial heap size. Could not create the Java virtual machine What is the difference between s, c and r commands in vi/vim? HTTP HEAD request with HttpClient in .NET 4.5 and C# App.config - LocalSqlServer connection string C# HttpClient 4.5 multipart/form-data upload

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy