Module: KtCommon::Date
- Defined in:
- lib/ktcommon/date.rb
Instance Method Summary collapse
-
#current_date ⇒ Object
Alias for #datestamp.
-
#current_datetime ⇒ Object
Alias for #timestamp.
-
#datestamp ⇒ Object
Return a datestamp string including only the date.
-
#timestamp ⇒ Object
Return a timestamp string including both date and time.
Instance Method Details
#current_date ⇒ Object
Alias for #datestamp
51 52 53 |
# File 'lib/ktcommon/date.rb', line 51 def current_date() return datestamp() end |
#current_datetime ⇒ Object
Alias for #timestamp
43 44 45 |
# File 'lib/ktcommon/date.rb', line 43 def current_datetime() return () end |
#datestamp ⇒ Object
Return a datestamp string including only the date.
- returns
-
datestamp string
34 35 36 37 |
# File 'lib/ktcommon/date.rb', line 34 def datestamp() now = Date::today() now.strftime("%m/%d/%Y") end |
#timestamp ⇒ Object
Return a timestamp string including both date and time.
- returns
-
timestamp string
23 24 25 26 |
# File 'lib/ktcommon/date.rb', line 23 def () now = DateTime::now() now.strftime("%m/%d/%Y %H:%M:%S") end |