How to use GetDateElementsFromTimestamp?
I need to log the date the addon was first initialized, and check if it's the same day/week to reset a variable. But I don't know how to use the in-game function or get the variables from it. Thus far I've only used functions I've created myself. So, how do I do that?
|
Code:
--- @param timestamp integer53 Rough example Lua Code:
Add event_add_on_loaded you need to save the current timestamp to your SavedVariables then. Remember that event is called each time for all addons so only update if YOUR addon is found, and also remember that event is called on each reloadui too! So only update once per same year, month and day e.g. or you will overwrite it on each reloadui/login with current date. Your check "old vs. current" needs to be done before updating the SavedVariables too or you will always comapre current with current. |
Quote:
|
All times are GMT -6. The time now is 04:15 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI