What’s the easiest way to give a Time object representing a given time (say 5pm) on a given date (say 1/1/2010) in a given time zone (say EST)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m a big fan of Time.parse, although Time.mktime is also an option:
Note that Time.mktime always renders results using the local timezone, so Time.parse is more flexible in that regard.