Date and time functions
Posted: Sun Aug 04, 2002 11:43 pm
I wrote a small library for handling date and time values.
// Name : Date and time functions
// Author : Ingmar Stieger / Papillon
// Modified : August 04, 2002
// Version : 0.1
// Implemented datatype
// * DateTime
// Implemented functions
// * addDateTime() : Add two DateTimes
// * subDateTime() : Substract two DateTimes
// * compareDateTime() : Compare two DateTimes
// * getCurrentDateTime() : Return current DateTime
// * newDateTime() : Create new DateTime with given values
// * SetLocalDateTime() : Set oObject's local DateTime variable to date
// * GetLocalDateTime() : Get oObject's local DateTime variable
// * debugPrintDateTime() : Print DateTime for debugging purposes
// See function headers for details
//
// Example:
/* object oPC = GetPCSpeaker();
struct DateTime date1 = getCurrentDateTime();
struct DateTime date2 = newDateTime(0,0,0,8); // 8 hours later
struct DateTime finished = addDateTime(date1, date2);
SetLocalDateTime(oPC, "forge_shortsword_blade_finished", finished);
*/
--- cut
The source is too long to post here, but I've attached it as a .erf file.
// Name : Date and time functions
// Author : Ingmar Stieger / Papillon
// Modified : August 04, 2002
// Version : 0.1
// Implemented datatype
// * DateTime
// Implemented functions
// * addDateTime() : Add two DateTimes
// * subDateTime() : Substract two DateTimes
// * compareDateTime() : Compare two DateTimes
// * getCurrentDateTime() : Return current DateTime
// * newDateTime() : Create new DateTime with given values
// * SetLocalDateTime() : Set oObject's local DateTime variable to date
// * GetLocalDateTime() : Get oObject's local DateTime variable
// * debugPrintDateTime() : Print DateTime for debugging purposes
// See function headers for details
//
// Example:
/* object oPC = GetPCSpeaker();
struct DateTime date1 = getCurrentDateTime();
struct DateTime date2 = newDateTime(0,0,0,8); // 8 hours later
struct DateTime finished = addDateTime(date1, date2);
SetLocalDateTime(oPC, "forge_shortsword_blade_finished", finished);
*/
--- cut
The source is too long to post here, but I've attached it as a .erf file.