LibTime-1.0
Every addon author eventually hits the same wall: World of Warcraft hands you a handful of scattered time functions, and none of them quite do what you need. Server time drifts, local time ignores time zones, and played-time tracking requires a client request you have to remember to fire. LibTime-1.0 exists to smooth all of that out. It is a compact, embeddable library that wraps date, time, and playtime calls into one clean API, so you can spend your coding hours on features instead of clock math.
What LibTime-1.0 Actually Does
At its core, this is a utility library accessed through LibStub. Once embedded, you grab a reference with a single line and the whole toolkit opens up. The library focuses on four practical areas: server game time, local and UTC time, per-country time zones, and played-time tracking. It also formats any of those values into a ready-to-display string, which saves you from writing the same padding logic in every addon you maintain.
Game Time With Sync Awareness
The GetGameTime function detects the current server time in seconds and returns hours, minutes, seconds, plus a fourth boolean that signals whether the value is synchronized. That last return is genuinely useful. If your addon shows a clock, you can grey out or annotate the display until synchronization completes, rather than presenting a stale number as gospel.
Local, UTC, and Country Time
GetLocalTime and GetUTCTime cover the obvious cases, and GetUTCTime accepts an optional flag to return raw seconds since the Unix epoch instead of a broken-down clock reading. GetCountryTime goes further, taking a country ID and returning hours, minutes, seconds, and the country name. Need to iterate every supported country? The iterateCountryList iterator hands you ID and name pairs in a simple loop, which is ideal for building dropdown menus.
One Formatter to Rule Them All
GetTimeString is the workhorse. You pass a source type, toggle 24-hour mode, choose whether to show seconds, and optionally supply a country ID. Out comes a formatted string like "14:30" or "02:30:15 PM". Consistent formatting across your entire addon suite becomes a one-call affair.
Played Time Without the Headache
Tracking how long a character has been played is notoriously fiddly. LibTime-1.0 handles it by calling RequestTimePlayed on startup and then adding session time to every subsequent query. Call RequestPlayedTime first, and GetPlayedTime returns total played time, played time at the current level, and the current session length. If you are building a session timer or a leveling tracker, this alone justifies the download.
Installation is refreshingly simple for developers and end users alike. If you are wondering how to install, the library ships embedded inside the addons that use it, so there is usually nothing to configure manually. For players who prefer a hands-off approach, the foxygame.net launcher can handle LibTime-1.0 as part of a one-click addon installation, pulling the correct build and keeping it current without any folder shuffling.
Version Compatibility Across Every Client
One of the quiet strengths of LibTime-1.0 is how broadly it travels. The library works across Retail, Classic, TBC, WotLK, Cataclysm, and MoP clients, which matters enormously if you maintain addons for multiple branches. Time handling differs subtly between these versions, and having a single abstraction layer means your addon code stays identical while the library absorbs the differences underneath.
- Retail: full support for all time and played-time functions.
- Classic and TBC: consistent behavior for era-accurate addons.
- WotLK, Cataclysm, and MoP: compatible formatting and country lookups.
- Embedded via LibStub: no standalone installation required.
Why Developers Keep It in Their Toolbox
Libraries like this rarely get attention, and that is precisely the point. LibTime-1.0 stays out of the way, does one job thoroughly, and lets your addon's interface shine. Whether you are writing a roleplay clock, a raid scheduling tool, or a simple session tracker, the API is small enough to learn in minutes and stable enough to trust for years. If you build for World of Warcraft, download LibTime-1.0 and stop reinventing the clock.