Module: KtCommon::Date

Defined in:
lib/ktcommon/date.rb

Instance Method Summary collapse

Instance Method Details

#current_dateObject

Alias for #datestamp



51
52
53
# File 'lib/ktcommon/date.rb', line 51

def current_date()
		return datestamp()
end

#current_datetimeObject

Alias for #timestamp



43
44
45
# File 'lib/ktcommon/date.rb', line 43

def current_datetime()
		return timestamp()
end

#datestampObject

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

#timestampObject

Return a timestamp string including both date and time.

returns

timestamp string



23
24
25
26
# File 'lib/ktcommon/date.rb', line 23

def timestamp()
	now = DateTime::now()
	now.strftime("%m/%d/%Y %H:%M:%S")
end