fixed: there were mktime() used on some dirs Items

so sometimes the time of the dir was changed

now for converting tm into time_t use:
time_t Time(const tm & par);
time_t Time(const tm * par);
tm     Time(time_t par);
from core/misc.h

now winix internally use GMT time
only when printing it is converted to local user time
temporarily all users use the same local time (config: time_zone_offset)
(only logs are genereted with local system time)

added to system:
time_t LocalTime(time_t gmt_time);
tm     LocalTime(const tm * ptm);
tm     LocalTime(const tm & ptm);
they convert GMT time to local user time




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@666 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-10-23 23:12:47 +00:00
parent a1bee81a5b
commit c48241f78a
33 changed files with 298 additions and 167 deletions

View File

@@ -14,7 +14,6 @@
struct Item
{
long id;
@@ -83,64 +82,12 @@ std::string auth_path; // path to a file (if auth!=auth_none)
std::string html_template;
// methods
Item()
{
Clear();
}
void SetDateToNow()
{
time_t t = std::time(0);
date_creation = *std::localtime( &t );
date_modification = date_creation;
}
void SetDateModifyToNow()
{
time_t t = std::time(0);
date_modification = *std::localtime( &t );
}
void Clear()
{
id = -1;
user_id = -1;
group_id = -1;
privileges = 0;
modification_user_id = -1;
guest_name.clear();
subject.clear();
content.clear();
url.clear();
content_type = ct_formatted_text;
type = none;
parent_id = -1;
default_item = -1;
content_id = -1;
auth = auth_none;
auth_path.clear();
html_template.clear();
SetDateToNow();
}
// methods
Item();
void SetDateToNow();
void SetDateModifyToNow();
void Clear();
};