Class: ReeDatetime::Now

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_datetime/package/ree_datetime/functions/now.rb

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
# File 'lib/ree_lib/packages/ree_datetime/package/ree_datetime/functions/now.rb', line 13

def call
  tz = get_default_tz_info
  offset = offset_to_string(tz.utc_offset)
  time = DateTime.now

  return time if time.zone == offset
    
  time.new_offset(offset)
end