Closed Mitlik closed 11 years ago
Thanks. This is next on the feature list.
I put the following proof of concept together using straight ruby 1.9 before noticing you must be using a gem or rails. But I thought I would offer it up.
cat >/tmp/time_test.rb << EOF
use_dst = false time_offset=-6 tm = Time.now
puts "DST: #{Time.now.isdst}" puts "Date: " + tm.strftime("%Y%m%d")
if use_dst and tm.isdst then adjusted_offset = time_offset +1 else adjusted_offset = time_offset end str_offset = "#{adjusted_offset.abs}" if adjusted_offset.abs < 10 then str_offset = "0" + str_offset end if adjusted_offset < 0 then str_offset = "-" + str_offset end
puts "Offset: " + str_offset puts "Hello, World! It is " + tm.localtime(str_offset + ":00").strftime("%R")
EOF ruby /tmp/time_test.rb
Ok, I think this is fixed. Full list of available timezone strings is here: https://github.com/maciakl/MarkdownJournal/wiki/Timezones
Time stamps are two hours behind my current location.