Method: Origami::Date.now

Defined in:
lib/origami/string.rb

.nowObject

Returns current Date String in UTC time.



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/origami/string.rb', line 422

def self.now
    now = Time.now.utc

    date =
    {
        year: now.strftime("%Y").to_i,
        month: now.strftime("%m").to_i,
        day: now.strftime("%d").to_i,
        hour: now.strftime("%H").to_i,
        min: now.strftime("%M").to_i,
        sec: now.strftime("%S").to_i,
        utc_offset: now.utc_offset
    }

    Origami::Date.new(date)
end