Skip to content

Instantly share code, notes, and snippets.

@zyriuse75
Created March 31, 2014 12:51
Show Gist options
  • Save zyriuse75/a5a919d5beeab3d2089f to your computer and use it in GitHub Desktop.
Save zyriuse75/a5a919d5beeab3d2089f to your computer and use it in GitHub Desktop.
require 'fileutils'
require 'time'
#require 'rubygems' if RUBY_VERSION < '1.9'
require 'date'
@date_array = [7, 1]
@array_date =Array.new
@array_timestampdate =Array.new
@date_array.map do |dday|
@array_date << (Date.today-dday).strftime("%Y-%m-%d-23:00:00")
end
@array_date.map do |f|
@array_timestampdate << Time.parse(f).to_i
puts "date timestamp monday #{@array_timestampdate[0]}"
puts "date timestamp friday #{@array_timestampdate[1]}"
end
i get this :
date timestamp monday 1395615600
date timestamp friday 1396134000
date timestamp monday 1395615600
date timestamp friday 1396134000
it's exatly what i want 30/3/2014 à 0:00:00
in my other server i get this 30/3/2014 à 1:00:00
date timestamp monday 1395619200
date timestamp friday 1396137600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment