• Warhammer Online Addons
  • Warhammer Online
  • Average Rating:

  • Your Rating

  • Share
  • Report Abuse

LibDateTime

 

Project Updated:
Files Updated: Wed, Nov 19 2008
Supports Game Version: Beta 3.0
Category: Development Tools
Tags:

[Edit Tags]

Project Manager: Garko
Additional Authors: No additional authors
Current Version: release-0.4.7
License: Public Domain
Development Site: CurseForge
Avg Daily DL (last 30 days): 5
Downloads Total: 4,330
Favorites: 12
Comments: 10
  • Contests
  • About LibDateTime
  •  

LibDateTime provide locale date and time, formatting function, clock callback and more DateTime functions. This library is localized in English, French, German, Spanish and Italian.

This library can be include in another addon.

Documentation

DateTime type :

This is a table with following format and support
{
  year = 2008,
  month = 9,
  day = 12,
  hour = 12,
  minute = 0,
  second = 0
}

LibDateTime:New(year, month, day, hour, minute, second)

Returns a DateTime table.

year: a number (default: 1970)
month: a number (default: 1)
day: a number (default: 1)
hour: a number (default: 0)
minute: a number (default: 0)
second: a number (default: 0)

LibDateTime:Now()

Returns current DateTime.

LibDateTime:GameStartedSince()

Returns the number of seconds since the game begin.

LibDateTime:IsLeapYear(year)

Return true if year is a leap year.

LibDateTime:YearDay(datetime)

Returns a number representing the day of the year (1..366).

datetime: a DateTime table

LibDateTime:WeekDay(datetime)

Returns week day number (1..7 => Mon..Sun).

datetime: a DateTime table

LibDateTime:Format(datetime, format)

Returns formatted DateTime.

datetime: a DateTime table
format: a format string
Code to use in format string:
%a - The abbreviated weekday name (``Sun)
%A - The full weekday name (``Sunday)
%b - The abbreviated month name (``Jan)
%B - The full month name (``January)
%d - Day of the month (01..31)
%H - Hour of the day, 24-hour clock (00..23)
%I - Hour of the day, 12-hour clock (01..12)
%j - Day of the year (001..366)
%m - Month of the year (01..12)
%M - Minute of the hour (00..59)
%p - Meridian indicator (``AM or ``PM)
%S - Second of the minute (00..60)
%w - Day of the week (Sunday is 0, 0..6)
%y - Year without a century (00..99)
%Y - Year with century
%% - Literal ``% character
 LibDateTime.Format(datetime, "%d/%m/%Y %H:%M:%S") => "12/09/2008 12:00:00"
 LibDateTime.Format(datetime, "%Y-%m-%d %H:%M:%S") => "2008-09-19 12:00:00"

LibDateTime:DateTime2UnixTime(datetime)

Convert a `DateTime' to unix time.

datetime: a DateTime table

LibDateTime:RegisterClock(callback)

Register a clock function to call every second when DateTime is updated. Return handle string if successful registered, or false if not. The callback method receive a DateTime table in argument.

callback: is a function or a string (function name)
 LibDateTime.RegisterClock(MyMod.MyClockFunction)
 LibDateTime.RegisterClock("MyMod.MyClockFunction")

LibDateTime:UnRegisterClock(handle)

Unregister the clock responding to handle string (returned by LibDateTime.RegisterClock).

handle: a handle string

LibDateTime:IsInitialized()

Returns true if LibDateTime is initialized

  • Downloads (7)
  •  
File Name Release Type Game Version Downloads Date
Addon Curse.com Beta 2.3.3 0 9/29/2008
  File Name Release Type Game Version Downloads Date  
  LibDateTime release-0.4.7 Release Beta 3.0 3,950 11/19/2008
  LibDateTime release-0.4.6 Release Beta 3.0 81 11/15/2008
  LibDateTime release-0.4.4 Release Beta 3.0 36 11/15/2008
  LibDateTime beta-0.4.3 Beta Beta 3.0 62 10/26/2008
  LibDateTime beta-0.4.2 Beta Beta 3.0 29 10/23/2008
  • Comments

Add Comment  

Add

You need to login or register to post.

Benefits of Registration

  • Interact with hundreds of thousands of other gamers on an open social network.
  • Post your stories, news, images, videos, and other content to share.
  • Create a network with your fellow gamers or join an existing one.
  • Gain reputation for everything you do.
  • twentyfive said

    Great mod, it works well except when trying to use it during init(before the game start handling events). Since the LibDateTimeOnUpdateDONOTTOUCH hasn't been called yet, the mod won't be initalized and will return a nill value. A simple work around is to call force a call to LibDateTimeOnUpdateDONOTTOUCH.

    Reply Report Permalink
  • sleaper said

    when i open the debug window with this is scrolling past non stop every 10th of a second, maybe more

    [08/12/06][15:44:43][Function]: (LibDateTime): LibDateTimeOnUpdateDONOTTOUCH( 0.0259 )

    now i know it's a dev tool, but it has nothing scrolling with it, just that, anything i should be concerned about?

    Reply Report Permalink
  • Same here, and when I have LibDateTime installed I CTD atleast once an hour. The fact that this is called atleast 10 times a second has to contribute to the CTD. No other mod/addon/lib/functions are called anywhere near as fast as this is.

    Sucks that 3 addons I like to use are dependent on this. (map monster, book of grudges, map monster navigator).

    Reply Report Permalink
  • wont let me install using the curse client ...

    Reply Report Permalink
  • LibDate needs to use the new LibStub, theres a bug with version 3 you have included, should package LibStub as an external to keep up to date

    Reply Report Permalink
  • torolan said

    Ok seems to be this addon, went ahead and uninstalled it and the clock in middle of my screen went away.

    Reply Report Permalink
  • Garko said

    hum, sorry.

    I don't have see this problem with recursive mod folder. I repair this to dontt add clock.

    Reply Report Permalink
  • torolan said

    Saw this mod was updated today, and I now have a clock in the middle of my screen. Is there a way to disable this if this mod was in fact the one responsible for it?

    Reply Report Permalink
  • Garko said

    The version beta 0.4.3 add more documentation about inclusion of LibDateTime in another addon package. This version add new method CopyDateTime (to copy a DateTime table) and now, LibDateTime functions returns already a new DateTime table.

    Reply Report Permalink
  • Another ticket for problems with the formatting again

    Reply Report Permalink
  • Filed a couple tickets for you on curseforge, seems days and months have been mixed up in the docs, and the date2unixtime fails with an error. Otherwise its a great lib

    Reply Report Permalink
  • Garko said

    Thanks for yours reports, I have updated to version beta-0.4.2 (more informations in tickets comments).

    I have a problem with big integer for UnixTime, because is not updated when I call DateTime2UnixTime more one time (in macro environment). I don't know where is the problem, but I investigate to resolve this.

    Reply Report Permalink
  • Branderic said

    Wow, I had no idea they had a Calandar hidden in there! Good work.

    Reply Report Permalink
  • Garko said

    Thanks,

    The new version (0.2.0) add more format string options (names and weekday number), new functions (GameStartedSince, New, YearDay, and WeekDay) and the library is localized now (for formatting).

    Reply Report Permalink
  • 1 page(s)
  • Similar Addons
  •  

Average downloads per day

  1. 199 LibSlash Development Tools
  2. 75 Phantom Buffs & Debuffs, Development...
  3. 46 NerfedButtons Action Bars, and Development...
  4. 24 LibSurveyor Development Tools
  5. 19 RV_Mods Unit Frames, Combat, Development...