From fc0545bc56e9cf32849d17d026a998b257d2124e Mon Sep 17 00:00:00 2001 From: myun2 Date: Sat, 7 Jul 2012 18:24:00 +0900 Subject: [PATCH] unixtime.hpp --- roast/include/roast/time/unixtime.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/roast/include/roast/time/unixtime.hpp b/roast/include/roast/time/unixtime.hpp index 4513ac45..21a45096 100644 --- a/roast/include/roast/time/unixtime.hpp +++ b/roast/include/roast/time/unixtime.hpp @@ -24,18 +24,18 @@ namespace roast { protected: // UNIX Time Value - unix_time_type m_time; + unix_time_type m_unixtime; public: // Constructor - unix_time(){ m_time = get_unix_time_now(); } - unix_time(const unix_time_type& tm) : m_time(tm) {} + unix_time(){ m_unixtime = get_unix_time_now(); } + unix_time(const unix_time_type& tm) : m_unixtime(tm) {} // Accessors - unix_time_type get() const { return m_time; } - unix_time_type get_time() const { return m_time; } - unix_time_type to_time() const { return m_time; } - void set(const unix_time_type& tm) { m_time = tm; } - void set_time(const unix_time_type& tm) { m_time = tm; } + unix_time_type get() const { return m_unixtime; } + unix_time_type get_time() const { return m_unixtime; } + unix_time_type to_time() const { return m_unixtime; } + void set(const unix_time_type& tm) { m_unixtime = tm; } + void set_time(const unix_time_type& tm) { m_unixtime = tm; } // Time Values int get_second() const { return m_unixtime % 60; } @@ -45,16 +45,16 @@ namespace roast // To String ::std::string to_string() const { - return ::ctime(&m_time); + return ::ctime(&m_unixtime); } // To struct tm struct ::tm to_struct_tm() const { return to_struct_tm_local(); } - struct ::tm to_struct_tm_gmt() const { return *(::gmtime(&m_time)); } - struct ::tm to_struct_tm_local() const { return *(::localtime(&m_time)); } + struct ::tm to_struct_tm_gmt() const { return *(::gmtime(&m_unixtime)); } + struct ::tm to_struct_tm_local() const { return *(::localtime(&m_unixtime)); } // Operators - operator unix_time_type() const { return m_time; } + operator unix_time_type() const { return m_unixtime; } }; typedef unix_time unixtime; -- 2.11.0