Skip to content

Commit

Permalink
Merge pull request yedf2#17 from lzgdjl/master
Browse files Browse the repository at this point in the history
modify uti.cc make it more readable/ fix readable month bug
  • Loading branch information
yedf2 authored Jan 22, 2017
2 parents 1cfbaad + 937a096 commit 0bb590a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handy/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ std::string util::readableTime(time_t t) {
struct tm tm1;
localtime_r(&t, &tm1);
return format("%04d-%02d-%02d %02d:%02d:%02d",
tm1.tm_year+1900, tm1.tm_mon, tm1.tm_mday, tm1.tm_hour, tm1.tm_min, tm1.tm_sec);
tm1.tm_year+1900, tm1.tm_mon+1, tm1.tm_mday, tm1.tm_hour, tm1.tm_min, tm1.tm_sec);
}

int util::addFdFlag(int fd, int flag) {
int ret = fcntl(fd, F_GETFD);
return fcntl(fd, F_SETFD, ret | flag);
}

}
}

0 comments on commit 0bb590a

Please sign in to comment.