Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/clir/Date_utils.rb

Instance Method Summary collapse

Instance Method Details

#jj_mm_aaaa(separator = '/') ⇒ String

Returns French date with separator.

Examples:

Time.now.jj_mm_yyyy # => "28/12/2022"

Parameters:

  • separator (String) (defaults to: '/')

    Separator to use (default: ‘/’)

Returns:

  • (String)

    French date with separator



135
136
137
# File 'lib/clir/Date_utils.rb', line 135

def jj_mm_aaaa(separator = '/')
  self.strftime(['%d','%m','%Y'].join(separator))
end

#mm_dd_yyyy(separator = '/') ⇒ String

Returns English date with separator.

Examples:

Time.now.mm_dd_yyyy # => "12/28/2022"

Parameters:

  • separator (String) (defaults to: '/')

    Separator to use (default: ‘/’)

Returns:

  • (String)

    English date with separator



144
145
146
# File 'lib/clir/Date_utils.rb', line 144

def mm_dd_yyyy(separator = '/')
  self.strftime(['%m','%d','%Y'].join(separator))
end