Class: Nx::DateTime
- Inherits:
-
Object
- Object
- Nx::DateTime
- Defined in:
- lib/nx/version.rb,
lib/nx/date-time.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
- .date ⇒ Object
- .date_time ⇒ Object
- .format(fmt) ⇒ Object
- .now ⇒ Object
- .time ⇒ Object
- .ym ⇒ Object
- .ymd_hms ⇒ Object
Class Method Details
.date ⇒ Object
13 14 15 |
# File 'lib/nx/date-time.rb', line 13 def date format "%Y-%m-%d" end |
.date_time ⇒ Object
21 22 23 |
# File 'lib/nx/date-time.rb', line 21 def date_time format "%Y-%m-%d %H:%M:%S" end |
.format(fmt) ⇒ Object
8 9 10 11 |
# File 'lib/nx/date-time.rb', line 8 def format(fmt) time = Time.now time.strftime(fmt) end |
.now ⇒ Object
4 5 6 |
# File 'lib/nx/date-time.rb', line 4 def now Time.now.to_i end |
.time ⇒ Object
17 18 19 |
# File 'lib/nx/date-time.rb', line 17 def time format "%H:%M:%S" end |
.ym ⇒ Object
25 26 27 |
# File 'lib/nx/date-time.rb', line 25 def ym format "%Y-%m" end |
.ymd_hms ⇒ Object
29 30 31 |
# File 'lib/nx/date-time.rb', line 29 def ymd_hms format "%Y%m%d_%H%M%S" end |